What is the temporal dead zone?
let and const have two broad differences from var: They are block scoped. Accessing a var before it is declared has the result undefined; accessing a let or const before it is declared throws ReferenceError: console.log(aVar); // undefined console.log(aLet); // Causes ReferenceError: Cannot access ‘aLet’ before initialization var aVar = 1; let aLet = 2; … Read more