Do you know what will be the output of this code?
JavaScript
console.log(b);
let b = 5;
Show answer and explanation
The answer is ReferenceError: Cannot access 'b' before initialization.
let and const are hoisted too, but they stay uninitialized until their declaration line runs. The time in between is called the temporal dead zone.