JavaScript & TypeScript

Chapter 2: Scope, Closures, Hoisting & Lexical Environments

How JavaScript resolves variable names statically at author time via lexical environment chains, why `let`/`const` eliminate `var` bugs, and how closures capture state cleanly.