Temporal Dead Zone (TDZ)
Temporal Dead Zone (TDZ) — The temporal dead zone is the period between entering a scope and the declaration of a `let` or `const` variable, during which accessing the variable throws a ReferenceError. Unlike `var` (which is initialized with `undefined` when hoisted), `let` and `const` variables are hoisted but not initialized. They exist in a "temporal dead zone" from the start of the block until their declaration is reached. Accessing them before declaration throws a ReferenceError, helping catch bugs early. This term relates to the Function category of the reference. You will meet temporal dead zone (tdz) in practice when working with APIs such as Function.prototype.call(), Function.prototype.apply(), Function.prototype.bind(), Function.prototype.toString(). Related terms: Closure, Hoisting, Event Loop, Prototype Chain, IIFE (Immediately Invoked Function Expression), Currying. Understanding temporal dead zone (tdz) makes the rest of the JavaScript documentation noticeably easier to follow, because the concept recurs across methods, guides, and error messages.