Use let for a block-scoped JavaScript binding. The binding is hoisted but remains uninitialized until execution reaches its declaration, creating the Temporal Dead Zone (TDZ). section 3.1
Interview trap: access before declaration
In `function greet() { console.log(message); let message = "Hello, world!"; }`, calling `greet()` throws a `ReferenceError: Cannot access 'message' before initialization`. Unlike var, let is not initialized to undefined during hoisting. section 3.1
Explain these points when discussing let in an interview:
- Distinguish hoisting from initialization: the binding exists, but TDZ access fails. section 3.1
- Contrast let with var: var receives undefined before assignment, whereas let produces a ReferenceError. section 3.1
- Recognize that removing strict mode does not change TDZ behavior; ES6 specifies it independently of strict mode. section 3.1




