Module 6 · Scope, Hoisting and Closures
CP and Interview Pack: The Loop Question, Hoisting Puzzles and the Bug Gallery
ProReading
Alice is in a mock interview, and she has just said "a closure is a function that remembers where it was made". The interviewer smiles and types a three-line loop. "What does this print? Then fix it three ways." That second question is where most candidates slow down. This lesson trains the second question and the ones after it, with every answer run on Node 22 rather than remembered.
Checking what this lesson needs for you…
What is inside CP and Interview Pack: The Loop Question, Hoisting Puzzles and the Bug Gallery
- The loop question, in three forms
- Eight puzzles: what will this print?
- The closure patterns, from memory
- Six interview questions, with model answers
- The contest angle: comparators and a memo that stays