Which of the following best describes how JavaScript handles the ‘this’ keyword inside a regular method called without explicit context? JavaScript DeveloperMedium Try Now
What does the following code output? const arr = [1, [2, [3]]]; console.log(arr.flat(1)); JavaScript DeveloperMedium Try Now
What is the difference between Object.entries() and Object.fromEntries()? JavaScript DeveloperMedium Try Now
What does Array.prototype.reduce() return when called on an empty array without an initial value? JavaScript DeveloperMedium Try Now
Which of the following correctly uses a getter in a JavaScript object literal? JavaScript DeveloperMedium Try Now
What does the following code produce? function* gen() { yield 1; yield 2; return 3; } const g = gen(); console.log([…g]); JavaScript DeveloperMedium Try Now
What does the following code output? console.log(‘a’); setTimeout(() => console.log(‘b’), 0); Promise.resolve().then(() => console.log(‘c’)); console.log(‘d’); JavaScript DeveloperMedium Try Now
What is the output of the following? async function foo() { return 42; } console.log(foo()); JavaScript DeveloperMedium Try Now
What does the following snippet demonstrate? const memoize = fn => { const cache = new Map(); return (…args) => { const key = JSON.stringify(args); if (cache.has(key)) return cache.get(key); const result = fn(…args); cache.set(key, result); return result; }; }; JavaScript DeveloperMedium Try Now
Which approach correctly creates a deep copy of a plain JSON-serializable object in modern JavaScript? JavaScript DeveloperMedium Try Now
What is the difference between shallow copy and deep copy of an object? JavaScript DeveloperMedium Try Now