Hint
let/const are in TDZ from block start to declaration. Even typeof throws ReferenceError in TDZ.
console.log(typeof x);
console.log(typeof y);
let x = 1;
var y = 2;ReferenceError: Cannot access 'x' before initialization
Explanation: let is hoisted but stays in the Temporal Dead Zone (TDZ) until its declaration. Accessing it before declaration throws ReferenceError, not undefined. typeof does NOT save you here.
Key Insight: let/const are in TDZ from block start to declaration. Even typeof throws ReferenceError in TDZ.