The JavaScript execution model governs how code runs, variables resolve, and runtime context is maintained. Interviewers use it to assess scope tracing, debugging, and reasoning about real-world code. section 3.1
Core areas to explain and apply include:
- Execution contexts and scope: distinguish global, function, and block scope; explain hoisting; trace the scope chain and closures. section 3.1
- Hoisting and the Temporal Dead Zone: recognize why accessing a let variable before initialization throws a ReferenceError. section 3.1
- Runtime context: resolve this bindings in functions, objects, arrow functions, and event handlers. section 3.1
Closure state and retention
A function returned by outer retains access to count: repeated counter() calls produce 1, 2, and 3. Persistent closures can also retain large objects, so handlers should clear retained data and be removed when no longer needed.


