What distinguishes the module record’s [[RequestedModules]] from [[ImportedBindings]] in the ECMAScript module linking algorithm? JavaScript ProfessionalHard Try Now
What does the following code output? function test(a, b = a * 2, c = a + b) { return [a, b, c]; } console.log(test(3)); JavaScript ProfessionalHard Try Now
What is the output of the following code? const obj = { [Symbol.toPrimitive](hint) { if (hint === ‘default’) return ‘default’; return 42; } }; console.log(obj == ‘default’); JavaScript ProfessionalHard Try Now
What is the Spectre vulnerability and how does it affect JavaScript’s SharedArrayBuffer availability? JavaScript ProfessionalHard Try Now
What does the following Proxy demonstrate? const revocable = Proxy.revocable({}, { get: (t, k) => k }); console.log(revocable.proxy.foo); revocable.revoke(); console.log(revocable.proxy.bar); JavaScript ProfessionalHard Try Now
What is the output of the following code? const p = Promise.reject(new Error(‘fail’)); setTimeout(() => p.catch(e => console.log(e.message)), 0); JavaScript ProfessionalHard Try Now
What is the key difference between Object.seal() and Object.freeze()? JavaScript ProfessionalHard Try Now
What does the following code output? function* fibonacci() { let [a, b] = [0, 1]; while (true) { yield a; [a, b] = [b, a + b]; } } const fib = fibonacci(); console.log([…Array(5)].map(() => fib.next().value)); JavaScript ProfessionalHard Try Now
What does the following code demonstrate? const brand = Symbol(‘brand’); class MyArray extends Array { static [Symbol.hasInstance](instance) { return Array.isArray(instance); } } console.log([] instanceof MyArray); JavaScript ProfessionalHard Try Now
What is the output of the following code? class Counter { #count = 0; increment() { this.#count++; } get value() { return this.#count; } } const c = new Counter(); c.increment(); console.log(c.value, c.#count); JavaScript ProfessionalHard Try Now
What is the content-security-policy implication of using eval() or new Function() in JavaScript? JavaScript ProfessionalHard Try Now
What does the following code output, and what concept does it illustrate? const obj = { a: 1, b: 2, c: 3 }; const { a, …rest } = obj; console.log(rest); JavaScript ProfessionalHard Try Now
What is the difference between Atomics.wait() and Atomics.waitAsync()? JavaScript ProfessionalHard Try Now
What is the output of the following code? async function* asyncGen() { yield await Promise.resolve(1); yield await Promise.resolve(2); } (async () => { for await (const val of asyncGen()) { console.log(val); } })(); JavaScript ProfessionalHard Try Now
What does V8’s hidden class (shape) optimization do and what code pattern defeats it? JavaScript ProfessionalHard Try Now
What does the following code output? const handler = { get: (t, k) => k in t ? t[k] : 37 }; const p = new Proxy({}, handler); p.a = 1; console.log(p.a, p.b, ‘c’ in p); JavaScript ProfessionalHard Try Now
What is the significance of the ‘use strict’ directive in the context of the arguments object? JavaScript ProfessionalHard Try Now
What is the output of the following code? function outer() { let count = 0; return function inner() { return ++count; }; } const a = outer(); const b = outer(); console.log(a(), a(), b()); JavaScript ProfessionalHard Try Now