Hint
TDZ begins at block entry, not at the declaration line. A local let shadows the outer scope immediately, blocking access to both until the declaration.
let x = 'global';
function test() {
console.log(x);
let x = 'local';
console.log(x);
}
try {
test();
} catch (e) {
console.log(e.constructor.name);
}ReferenceError
Explanation: Even though global x exists, the let x declaration in test() "shadows" the global one starting from the top of the block. Accessing x before the let declaration = TDZ = ReferenceError.
Key Insight: TDZ begins at block entry, not at the declaration line. A local let shadows the outer scope immediately, blocking access to both until the declaration.