Notes
Variables defined with let cannot be redeclared:
The following code will give and error since the variable x is redeclared using let.
let x = 12;
let x = 15;
Variables declared inside a { } block cannot be accessed from outside the block:
{
let x = 10;
}
// You can not use x here
Redeclaring a variable inside a block will not redeclare the variable outside the block:
let x = 5;
// The value of x is 5 here
{
let x = 3;
// The value of x is 3 here
}
// The value of x is 5 here