JavaScript Es6 and more
Es6 refers to version of the ECMAScript programming language and adds many more features intended to make large-scale software development easier.

ESMAScript or Es6 was published in June 2015.
Additional features of Es6 has are the let, const keywords, JavaScript arrow function, for/off, classes, promises, symbol, default parameters, Array.find(), Array.findIndex(), new math methods, number properties, number methods and global methods.
Block bindings in JavaScript
Binding is actually variable. When we declare a variable, we actually bind a value in a specific part of the program.
Var declarations and hoisting
If we declare a variable using var, behind the scene of a program it will appear on top of the program. This is known as hoisting.
function myFunction(a, b)
{
var a, b = 4, 3; // this is hoisting
return a * b;
}
var x = myFunction(4, 3);
Block-Level Declarations
If we declare a variable in a block-level scope using any of let or const we can not access the declaration outside that block scope. Block-level scopes are declared inside of a function or inside of a block.
Let Declaration
If we declare any variable using let, means the property of the variable is changeable. Let declarations are not hoisted on top of the program. Which means we can declare the value as many times we want.
function func()
{
if (true){
var A = 1;
let B = 2;
}
A++; // 2 --> ok, inside function scope
B++; // B is not defined --> not ok, outside of block scope
return A + B; // NaN --> B is not defined
};
Const Declaration
If we declare any variable with const keyword, that means this value is unchangeable. we can not put the same value in other variables.
const b = 1; // this variable unique and can't change it.
TDZ: Temporal Dead Zone
Though TDZ is not in official ECMAScript specification. But this terms is often used for let and const variables. Couse for their non-hoisting behavior . when any variable declared in JavaScript program, the JavaScript engine hoist for either the var variable or puts it on TDZ as non-hoisting variable like let, const.
Block Binding in Loops
In JavaScript for loop we use a variable named i, it only used this variable in for loop. Outside of for loop this i variable will not exist.
var i; //defines i
for (i = 0; i < 5; i++) { //starts loop
console.log("The Number Is: " + i); //What ever you want
};
Global Block Bindings
When var is used in the global scope, it creates a new global variable, which is a property on the global object. That means you can accidentally overwrite an existing global using var. If we use let or const instead of var in global scope we can avoid the overwriting in variable.
Emerging Best Practices for Block Bindings
So we can use const for variable which is not going to change infuture.And we can use let keyword for the variables value gonna change. Instead of var we can use let very easily as they have same responsibilities.