Interview Q&A · JavaScript
JavaScript Interview Questions & Answers
All 204 JavaScript interview questions — fundamentals, functions and closures, prototypes and this, arrays, async, DOM, modules, modern ES6+, performance and coding tasks — with correct, up-to-date answers. This bank holds 204 questions across 18 topics and 11 topic groups. Every answer is written for current JavaScript versions, and each topic links to matching course lessons where they exist.
Every topic below links to its own page with all of its questions in one place.
Answers are checked against current language behaviour; old-guide claims are corrected.
Each topic points to the matching course lesson, and lessons point back here.
Featured questions in this bank
JavaScript Fundamentals
What is JavaScript?
JavaScript is a high-level, dynamically typed, interpreted (JIT-compiled) multi-paradigm language — the language of the web, now running on servers (Node.js), desktops and embedded targets via engines like V8, SpiderMonkey and…
Read the full answer →JavaScript Fundamentals
How does JavaScript code actually execute (engine pipeline)?
Source is parsed to an AST, compiled to bytecode (Ignition in V8), interpreted — then hot functions are JIT-optimized (TurboFan) with speculative assumptions, deoptimizing if reality differs. There is no manual compile step; the…
Read the full answer →Functions In Depth
What are the ways to define a function (and how do they differ)?
Declarations (function f(){}) hoist whole and name themselves. Expressions (const f = function(){}) follow variable hoisting (TDZ for const). Arrows ((x) => x) bind lexically (no own this/arguments) and suit callbacks. Methods…
Read the full answer →Functions In Depth
How do arrow functions differ from regular functions?
Arrows capture this/arguments lexically (no own bindings), cannot be constructors (no new, no prototype), have no arguments object (use rest), and return implicitly with concise bodies. Regular functions get dynamic this,…
Read the full answer →Objects & Prototypes
How do you create and use objects (literals, property access)?
Literals ({}) with shorthand ({x}), computed keys ({[k]: v}), and methods; access via dot (static known keys) or brackets (dynamic keys, special names). Destructuring unpacks; spread/rest clones and picks. Brackets-for-dynamic,…
Read the full answer →Objects & Prototypes
What is the prototype chain? How does property lookup work?
Every object links to a prototype (Object.getPrototypeOf); failed own-property lookups walk up the chain to Object.prototype, then undefined. Assignment always writes own properties (never up-chain); methods live on prototypes so…
Read the full answer →JavaScript Fundamentals
18 questions across 2 topics — What the language is, the engine pipeline, types and scope rules.
Functions & Closures
22 questions across 2 topics — Declarations, arrows, higher-order patterns, scope chains and closures.
Objects, Prototypes & this
20 questions across 2 topics — Prototype chain, classes, descriptors and the this binding rules.
Arrays, Strings & Collections
20 questions across 2 topics — Iteration toolkit, string mechanics, destructuring and Map/Set.
Async JavaScript
16 questions across 1 topic — Event loop, promises, async/await, cancellation and concurrency control.
DOM & Browser
14 questions across 1 topic — DOM manipulation, events, forms, storage, rendering and accessibility.
Modules & Metaprogramming
22 questions across 2 topics — ES modules, error handling, iterators, proxies and reflection.
Modern JavaScript (ES6+)
14 questions across 1 topic — What each era changed — optional chaining, records, resources and beyond.
Performance & Memory
12 questions across 1 topic — Measurement, bundles, GC behavior and 60fps rendering.
Tricky Outputs & Coding Tasks
26 questions across 2 topics — Prediction gotchas plus implement-it-now favorites in idiomatic JS.
Scenarios & Rapid Fire
20 questions across 2 topics — Production judgment calls, plus one-line revision for the night before.
Recommended resourcesAffiliate links · may earn us a commission