What is the difference between `Error.captureStackTrace()` and a regular `new Error()` in terms of stack trace manipulation? JavaScript DeveloperHard Try Now
What is the output of the following? “`js const a = { val: 1 }; const b = { val: 2 }; const weakSet = new WeakSet([a, b]); console.log(weakSet.has(a)); console.log(weakSet.size); “` JavaScript DeveloperHard Try Now
What is currying in JavaScript and how does it differ from partial application? JavaScript DeveloperHard Try Now
What is the output of the following? “`js const obj = {}; Object.defineProperty(obj, ‘x’, { get() { return 42; }, set(v) { console.log(‘set:’, v); } }); obj.x = 10; console.log(obj.x); “` JavaScript DeveloperHard Try Now
What is event delegation in JavaScript and why is it preferred over attaching listeners to each element? JavaScript DeveloperHard Try Now
What is the output of the following? “`js function* fibonacci() { let [a, b] = [0, 1]; while (true) { yield a; [a, b] = [b, a + b]; } } const fib = fibonacci(); const result = Array.from({length: 5}, () => fib.next().value); console.log(result); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js const target = { a: 1 }; const handler = { set(obj, prop, value) { obj[prop] = value * 2; return true; } }; const p = new Proxy(target, handler); p.b = 5; console.log(target.b); “` JavaScript DeveloperHard Try Now
What is the correct way to handle multiple async operations where you want ALL results including failures? JavaScript DeveloperHard Try Now
What is the output of the following? “`js function Person(name) { this.name = name; } Person.prototype.greet = function() { return `Hi, ${this.name}`; }; const p = Object.create(Person.prototype); p.name = ‘Alice’; console.log(p.greet()); console.log(p instanceof Person); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js const map = new Map(); const key = {}; map.set(key, ‘value’); console.log(map.get({})); console.log(map.get(key)); “` JavaScript DeveloperHard Try Now
What is memoization and how would you implement it for a pure function in JavaScript? JavaScript DeveloperHard Try Now
What is the output of the following? “`js let result = []; for (var i = 0; i < 3; i++) { result.push(() => i); } console.log(result.map(fn => fn())); “` JavaScript DeveloperHard Try Now
What is the difference between `Object.getPrototypeOf(obj)` and `obj.__proto__`? JavaScript DeveloperHard Try Now
What is the output of the following? “`js async function* asyncGen() { yield 1; yield 2; } async function run() { const gen = asyncGen(); console.log((await gen.next()).value); console.log((await gen.next()).value); } run(); “` JavaScript DeveloperHard Try Now
What is module scope in ES modules and how does `import` differ from CommonJS `require()`? JavaScript DeveloperHard Try Now
What is the output of the following? “`js const obj = { value: 42, getValue: function() { return this.value; }, getValueArrow: () => this.value }; console.log(obj.getValue()); console.log(obj.getValueArrow()); “` JavaScript DeveloperHard Try Now