Scope in javascript

JavaScript has global, function, and block scope. var is function-scoped, let/const are block-scoped. The temporal dead zone prevents accessing let/const before declaration. Scope determines variable visibility and lifetime.