Front End Developer Intern Interview Questions

12,593 front end developer intern interview questions shared by candidates

Write a function changeKey(obj, oldKey, newKey) that recursively replaces all occurrences of oldKey with newKey in an object or array. Do not change the key if it is "id". let obj = { id: 7373, data: [ { type: "1", id: 73 }, { name: "xyz", type: "23", vas_id: 73, x_data: [{ id: 72, data: { xx_data: { id: 673, a: ["id"] } } }, "id"], }, "abc", "id", 123, { id: { data: 123, id: ["a", "b"] } }, ], };
avatar

Front End React Developer

Interviewed at Fragma Data Systems

4.3
Nov 6, 2024

Write a function changeKey(obj, oldKey, newKey) that recursively replaces all occurrences of oldKey with newKey in an object or array. Do not change the key if it is "id". let obj = { id: 7373, data: [ { type: "1", id: 73 }, { name: "xyz", type: "23", vas_id: 73, x_data: [{ id: 72, data: { xx_data: { id: 673, a: ["id"] } } }, "id"], }, "abc", "id", 123, { id: { data: 123, id: ["a", "b"] } }, ], };

1. What will be the output of the following code? let i = 1; function incrementByValue(value) { i += value; return i; } function limit(fn, maxCalls) { let calls = 0; return function (...args) { if (calls < maxCalls) { calls += 1; return fn(...args); } return undefined; }; } const callbytimes = limit(incrementByValue, 2); console.log(callbytimes(2)); console.log(callbytimes(3)); console.log(callbytimes(4)); console.log(callbytimes(10));
avatar

Front End React Developer

Interviewed at Fragma Data Systems

4.3
Nov 6, 2024

1. What will be the output of the following code? let i = 1; function incrementByValue(value) { i += value; return i; } function limit(fn, maxCalls) { let calls = 0; return function (...args) { if (calls < maxCalls) { calls += 1; return fn(...args); } return undefined; }; } const callbytimes = limit(incrementByValue, 2); console.log(callbytimes(2)); console.log(callbytimes(3)); console.log(callbytimes(4)); console.log(callbytimes(10));

Viewing 751 - 760 interview questions

See Interview Questions for Similar Jobs

Glassdoor has 12,593 interview questions and reports from Front end developer intern interviews. Prepare for your interview. Get hired. Love your job.