Eave very differently than var's when enclosed by curly braces.
Let variables will be confined to the braces where they were created: block scoping.
Var variables are hoisted outside of any curly braces they are in (except functions, this is a topic for later).
The example below illustrates how var & let variables are treated differently by JavaScript whenever a new block is created.
A set of opening and closing curly braces create a new block scope. let variables are stuck inside of the block scope where they were declared, var variables are not.
let outer_let = 'outer let';
console.log('leaving outer scope');
{
console.log('entering block scope');
var inner_var = 'global var';
let inner_let = 'inner let';
console.log('leaving block scope');
};
console.log('re-entering outer scope');
inner_var = 'modified globally';
console.log('final state');
Let's temporal dead zone. (from step 3):