VAR:
⦁ It is introduced in ES1 (1997).It is used since in the beginning.
⦁ It is a functional or global scope(that means the variable declared var inside the function it is accessible only in the function and they declared in the outside the function and it is globally accessed ).
⦁ It allows redeclaration and reassignment .
LET:
⦁ It is introduced in ES6(2015).
⦁ It is a block scope(This means the variable declared let inside the block like if statements, for loops, or curly braces {} )only accessible inside the block.
⦁ It allows Redeclaration and not allows Reassignment.
CONST:
⦁ It is introduced in ES6(2015).
⦁ It is a block scope(This means the variable declared let inside the block like if statements, for loops, or curly braces {} )only accessible inside the block.
⦁ It not allows Redeclaration and Reassignment.
Top comments (0)