Skip to content

Part I — JavaScript Foundations ​

The section splits in two. Chapters 01–04 are the language's object model: how values are stored, where names resolve, and what class compiles down to. Chapters 05–06 are the runtime: how async work composes and fails, and the loop that schedules your callbacks.

Chapters ​

#ChapterWhat it answers
01Data Types, Variables and Built-insWhich values copy, which share, and which methods mutate?
02Scope and ClosuresWhere does a variable live, and why does this callback still see the old value?
03The this KeywordWhat is this, working from the call site alone?
04Prototypes and InheritanceWhat is class actually doing underneath?
05Promises, Async/Await and ErrorsHow do you compose async work, and fail in a way that is recoverable?
06The Event LoopIn what exact order will this code log?

What Interviewers Probe For ​

Three questions carry most of the weight in this section, on top of the part-level signal:

  • Do you know what a closure captures? Not the definition, but the consequence. Which variable does the captured reference point at? When does that keep an object alive? Why does the loop-with-var bug produce the number it does?
  • Can you explain this from the call site? Four rules, in precedence order, applied to code you are seeing for the first time. Some candidates memorised "arrow functions do not have this" and stopped there. The first method-extraction example catches them.
  • Do you treat errors as a design decision? Code review catches three common mistakes: swallowing a rejection, throwing a string, and losing the stack across an await. Knowing which failures are recoverable, and which should crash the process, is a seniority marker.

Reading Order ​

Straight through. Chapters 05 and 06 are a pair, because a promise's callback runs where the event loop puts it. Do not skip 06 because you have seen the diagram before.

Interview sprint: 02 → 03 → 06 → 05. Closures, this, the event loop and promise composition account for most of what the language round asks.

The whole book, free to read. Generated from the manuscript on every change.

Your progress

Tick each chapter in the sidebar once you have read and understood it. Your name and email keep the ticks on any device.

Your name and email are stored to save your progress. Nothing else is done with them.