Scope, Hoisting & Temporal Dead Zone in JavaScript
🟢 Beginner Level | JavaScript Core Syntax
📖 Definition
JavaScript supports Global, Function, and Block scope ({}). var is function-scoped and hoisted with undefined, while let/const are block-scoped and placed in the Temporal Dead Zone (TDZ) until initialization.
âš¡ Code Example
{
// console.log(x); // ReferenceError (TDZ)
let x = 10;
}
🧠Navigation
← Module Hub | Module Hub | 02. Destructuring & Rest/Spread Operators →