The language round

JavaScript Interview Questions

Closures, scope, prototypes, async behaviour and the runtime details interviewers use to separate memorisers from engineers.

Quiz me
40 questions14 easy21 medium5 hard0/40 learned
01What is a closure in JavaScript?Mediumscope · lexical environment · functions02What is the difference between var, let and const?Easyscope · hoisting · declarations03Explain the JavaScript event loopHardasync · runtime · event loop · promises04How does this work in JavaScript?Mediumthis · functions · call site05What is hoisting in JavaScript?Mediumhoisting · scope · execution context06What is the difference between == and ===?Easyequality · coercion · operators07What is the scope chain in JavaScript?Mediumscope · lexical environment · closures08How does prototypal inheritance work?Mediumprototypes · objects · inheritance09What does the new operator do?Mediumnew · constructors · prototypes10What is the difference between call, apply and bind?Mediumthis · functions · bind11What is the difference between arrow and regular functions?Easyfunctions · this · arguments12What is the difference between null and undefined?Easynull · undefined · types13What are the quirks of the typeof operator?Easytypeof · types · coercion14Which values are truthy and falsy in JavaScript?Easycoercion · booleans · conditionals15What is NaN and how should you check for it?Easynumbers · NaN · coercion16What is the difference between a shallow and deep copy?Mediumobjects · copying · immutability17Does const make an object immutable?Easyconst · immutability · objects18How do map, filter and reduce work?Easyarrays · map · filter · reduce19What is the difference between forEach and map?Easyarrays · forEach · map20What is the difference between slice and splice?Easyarrays · slice · splice · mutation21When should you use some, every, find or includes?Easyarrays · search · predicates22How does destructuring work?Easydestructuring · objects · arrays23What is the difference between spread and rest syntax?Mediumspread · rest · syntax24How do optional chaining and nullish coalescing work?Easyoptional chaining · nullish coalescing · operators25How do promises work and what are their states?Mediumpromises · async · chaining26How do async and await work, and how do you handle errors?Mediumasync · await · errors27What is the difference between Promise.all, allSettled, race and any?Hardpromises · concurrency · errors28What is currying and how is it different from partial application?Mediumfunctions · currying · closures29What is the difference between debounce and throttle?Mediumperformance · events · timers30What are generators and iterators in JavaScript?Hardgenerators · iterators · lazy evaluation31What is the difference between ES modules and CommonJS?Mediummodules · esm · commonjs32Why does array sort behave unexpectedly with numbers?Mediumarrays · sort · comparators33Why does 0.1 + 0.2 not equal 0.3?Mediumnumbers · floating point · BigInt34How do you fetch data and cancel a request?Mediumfetch · HTTP · AbortController35How does event bubbling and delegation work?Mediumevents · DOM · delegation36What is the difference between localStorage, sessionStorage and cookies?Mediumstorage · cookies · browser37What are the pitfalls of JSON.parse and JSON.stringify?MediumJSON · serialization · data38When should you use a Map instead of a plain object?MediumMap · objects · collections39When should you use Set, Map, WeakSet and WeakMap?HardSet · WeakMap · WeakSet · memory40How does garbage collection work and what causes memory leaks?Hardmemory · garbage collection · performance

Reading is step one

Now say it out loud.

Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live JavaScript mock interview and get scored feedback on depth, clarity and confidence.