Let Keyword
Variables defined with let cannot be Redeclared
Variables defined with let must be Declared before use
Variables defined with let have Block Scope
Variables defined with let can not be redeclared.
You can not accidentally redeclare a variable declared with let.
With let you can not do this:
let x = "John Doe";
let x = 0;
With var you can:
var x = "John Doe";
var x = 0;
const keyword
Variables defined with const cannot be Redeclared
Variables defined with const cannot be Reassigned
Variables defined with const have Block Scope
A const variable cannot be reassigned:
const PI = 3.141592653589793;
PI = 3.14; // This will give an error
PI = PI + 10; // This will also give an error
JavaScript const variables must be assigned a value when they are declared:
Correct : const PI = 3.14159265359;
Incorrect:const PI;
PI = 3.14159265359;