What is debouncing and how does it differ from throttling in JavaScript? JavaScript ProfessionalMedium Try Now
What is the output of the following? “`js function outer() { var x = 1; function inner() { var x = 2; console.log(x); } inner(); console.log(x); } outer(); “` JavaScript ProfessionalMedium Try Now
What is the output of the following? “`js const nums = [1, 2, 3, 4, 5]; const result = nums.reduce((acc, n) => n % 2 === 0 ? […acc, n * 2] : acc, []); console.log(result); “` JavaScript ProfessionalMedium Try Now
What is the difference between named exports and default exports in ES modules? JavaScript ProfessionalMedium Try Now
What is the output of the following? “`js async function foo() { try { await Promise.reject(new Error(‘oops’)); } catch(e) { console.log(e.message); } } foo(); “` JavaScript ProfessionalMedium Try Now
What is prototype-based inheritance and how does it differ from classical class-based inheritance? JavaScript ProfessionalMedium Try Now
What is the output of the following? “`js const fn = (function() { let count = 0; return { increment: () => ++count, getCount: () => count }; })(); fn.increment(); fn.increment(); console.log(fn.getCount()); “` JavaScript ProfessionalMedium Try Now
What is the difference between `Promise.any()` and `Promise.race()`? JavaScript ProfessionalMedium Try Now
What is the output of the following code? “`js const obj = { a: 1, b: 2 }; const { a, …rest } = obj; console.log(rest); “` JavaScript ProfessionalMedium Try Now
What is the difference between `shallow copy` and `deep copy` and which methods in JavaScript create each? JavaScript ProfessionalMedium Try Now
What is the output of the following? “`js console.log([] + []); console.log({} + []); console.log([] + {}); “` JavaScript ProfessionalMedium Try Now
What is the difference between `function declarations` and `function expressions` regarding hoisting? JavaScript ProfessionalMedium Try Now