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
What is the output of the following? “`js class Animal { constructor(name) { this.name = name; } speak() { return `${this.name} makes a noise.`; } } class Dog extends Animal { speak() { return `${this.name} barks.`; } } const d = new Dog(‘Rex’); console.log(d.speak()); console.log(d instanceof Animal); “` JavaScript DeveloperHard Try Now
What is tail call optimization and which JavaScript syntax enables it in strict mode? JavaScript DeveloperHard Try Now
What is the output of the following? “`js const handler = { get(target, key) { return key in target ? target[key] : 37; } }; const p = new Proxy({a: 1}, handler); console.log(p.a, p.b); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js console.log(1 + ‘2’ + 3); console.log(1 + 2 + ‘3’); “` JavaScript DeveloperHard Try Now
What is the correct way to implement a custom iterable in JavaScript? JavaScript DeveloperHard Try Now
What is the output of the following? “`js function foo() { ‘use strict’; console.log(this); } foo(); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js const sym = Symbol(‘key’); const obj = { [sym]: 42, name: ‘test’ }; console.log(Object.keys(obj)); “` JavaScript DeveloperHard Try Now
What is the difference between microtasks and macrotasks in the JavaScript event loop? JavaScript DeveloperHard Try Now