Flashcards · JavaScript · Free
JavaScript flashcards, generated for you.
Example JavaScript study cards to learn from right now — then generate a full set from your own notes (plus a practice quiz) and export to Quizlet or Anki. Free, no account needed.
Example JavaScript flashcards
What is the difference between `var`, `let`, and `const`?
`var` is function-scoped and hoisted; `let` and `const` are block-scoped. `const` prevents reassignment but not mutation of objects. Use `const` by default, `let` when reassignment is needed, avoid `var`.
What does `==` vs `===` do?
`==` performs type coercion (e.g., `'5' == 5` is true); `===` checks type and value without coercion (e.g., `'5' === 5` is false). Always use `===`.
What is hoisting?
JavaScript moves declarations to the top of their scope before execution. `var` and function declarations are fully hoisted; `let`/`const` are hoisted but not initialized (Temporal Dead Zone). Function expressions are not hoisted.
Explain `this` binding in JavaScript.
`this` refers to the object that called the method. In regular functions, `this` depends on call context (global/undefined in strict mode). In arrow functions, `this` is lexically bound to the parent scope.
What is a closure?
A closure is a function that accesses variables from its outer (enclosing) scope even after the outer function returns. Inner functions retain access to outer variables via the closure.
What is the difference between `null` and `undefined`?
`undefined` means a variable is declared but not assigned, or a function returns nothing. `null` is an explicit assignment meaning "no value." `typeof undefined === 'undefined'`; `typeof null === 'object'` (historical quirk).
How do prototypes and the prototype chain work?
Every JavaScript object has a `[[Prototype]]` (accessed via `__proto__` or `Object.getPrototypeOf()`). When a property is not found on an object, JavaScript looks up the prototype chain. `Object.create()`, constructors, and classes use prototypes for inheritance.
What is the event loop and how does it handle async code?
The event loop processes the call stack, then checks the microtask queue (Promises, `queueMicrotask`), then the macrotask queue (setTimeout, setInterval). Microtasks always run before macrotasks. Callbacks in the queues run only when the stack is empty.
What is the difference between `Promise.all()` and `Promise.allSettled()`?
`Promise.all()` rejects immediately if any promise rejects; it returns an array of results. `Promise.allSettled()` always waits for all promises and returns an array of objects with `{status, value/reason}`.
Why does `[1,2,3].map(parseInt)` return `[1, NaN, NaN]`?
`map()` passes `(element, index, array)` to the callback. `parseInt(1, 0)` = 1, `parseInt(2, 1)` = NaN (invalid radix), `parseInt(3, 2)` = NaN. Use `x => parseInt(x)` or `.map(Number)` to avoid this gotcha.
Make your own JavaScript study set
Flashcards for related topics
Studying JavaScript to build with AI? MindloomHQ turns it into real skills — structured courses, agent projects, and certificates.
Explore MindloomHQ →