120 original practice questions across 13 topics, every answer explained. Study mode shows the reasoning as you go; test mode holds it until the end.
120 questions
What is the Temporal Dead Zone?
What does console.log(typeof x) produce if x has never been declared?
Does const make an object immutable?
What is the scope of a var declaration inside an if block?
What does this log?
console.log(a);
var a = 5;Are function declarations hoisted differently from function expressions?
What does declaring var x at the top level of a script do in a browser?
What happens when you assign to an undeclared variable in strict mode?
What is the output?
let x = 1;
{
let x = 2;
console.log(x);
}
console.log(x);Can you redeclare a let variable in the same scope?
What does an arrow function NOT have its own binding for?
Can an arrow function be used with new?
What does a default parameter value trigger on?
What does the rest parameter ...args collect?
What is an IIFE?
What does Function.prototype.call do?
What does bind return?
What is a higher-order function?
What does this return?
function f() {
return
{ value: 1 };
}What is the difference between a parameter and an argument?
What does const { a = 5 } = { a: null } assign to a?
How do you rename a variable while destructuring?
Is the spread operator a deep or shallow copy?
What does const [a, , c] = [1, 2, 3] assign?
How do you swap two variables using destructuring?
What does the rest element in object destructuring collect?
Can you destructure a function parameter directly?
What does Math.max(...[1, 5, 3]) return?
What happens with duplicate keys when spreading two objects?
Can you spread a string?
What is the prototype chain?
What is the relationship between class and prototypes?
What does #count in a class body declare?
What does the static keyword do on a class member?
What must you call before using this in a derived class constructor?
What does Object.freeze prevent?
What does Object.entries(obj) return?
What is the difference between Object.keys and for...in?
What are getters and setters in a class or object literal?
What does optional chaining ?. return when the left side is null or undefined?
What does structuredClone do that spread does not?
What is Object.create(null) useful for?
What determines the value of this in a regular function call?
What is this inside an arrow function defined in an object literal method position?
Why does this log undefined?
const obj = { name: 'A', get() { return this.name; } };
const fn = obj.get;
fn();What is this inside a class method called normally?
How do class fields with arrow functions change binding?
What is this at the top level of an ES module?
What does globalThis provide?
What is this inside a setTimeout callback written as a regular function?
What is a closure?
What does this log?
for (var i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 0);
}Why does let fix the loop closure problem?
What is the module pattern?
What does a function returning a function that remembers a value demonstrate?
const counter = () => { let n = 0; return () => ++n; };What is currying?
What is memoization?
Can closures cause memory leaks?
Does Array.prototype.sort mutate the original array?
What does [10, 9, 1].sort() produce without a comparator?
What is the difference between slice and splice?
Can you break out of a forEach loop?
What does reduce do when called on an empty array with no initial value?
What does map return when the callback has no explicit return?
What does Array.from do that spread does not?
What does flat(Infinity) do?
What is the difference between find and filter?
What does at(-1) return?
What do the ES2023 methods toSorted, toReversed, toSpliced, and with have in common?
What does Object.groupBy (ES2024) return?
What are the three states of a Promise?
What does an async function always return?
What is the difference between Promise.all and Promise.allSettled?
What does Promise.race resolve with?
What does Promise.any reject with if every input rejects?
What is wrong with this?
const results = [];
for (const url of urls) {
results.push(await fetch(url));
}What happens to an unhandled promise rejection in Node.js?
Can try/catch catch an error from a promise you did not await?
What does .finally() receive as an argument?
What does chaining .then() return?
What does await do to a non-promise value?
How do you add a timeout to a fetch request?
What is a promise chain anti-pattern often called the "explicit construction antipattern"?
What does top-level await require?
What is the output order?
console.log('A');
setTimeout(() => console.log('B'), 0);
Promise.resolve().then(() => console.log('C'));
console.log('D');Which queue has higher priority: microtasks or macrotasks?
Does setTimeout(fn, 0) run immediately?
Is JavaScript single-threaded?
What happens when a long synchronous computation runs in the browser?
What is queueMicrotask used for?
What does process.nextTick do in Node relative to promises?
What is the output?
async function f() {
console.log(1);
await null;
console.log(2);
}
f();
console.log(3);What is a key difference between ES modules and CommonJS?
What does "live bindings" mean for ES module exports?
How many times does a module's top-level code execute across multiple imports?
What is the difference between a default and a named export?
What does import() (the function form) return?
Are ES modules in strict mode?
How do you designate a Node package as ESM?
What is tree shaking?
What makes an object iterable?
What does a generator function's yield do?
What does calling a generator function return?
What is the shape of the object returned by next()?
What is Symbol used for?
Are symbol-keyed properties included in Object.keys or JSON.stringify?
What is the difference between Map and a plain object?
What distinguishes WeakMap from Map?
What does typeof null return?
What is the difference between == and ===?
What does NaN === NaN evaluate to?
How does Object.is differ from ===?
Which values are falsy in JavaScript?
What is the difference between ?? and ||?
What do the logical assignment operators ||=, &&=, and ??= do?
What is optional catch binding?
What is the cause option on the Error constructor?
What is BigInt for?
What does a finally block do if the try block returns?
Why should you avoid JSON.parse(JSON.stringify(obj)) for deep cloning?