Difference table of var, let and const keyword is created, to easily understand its use.
var | let | const | |
Initialization | No | No | Yes |
Redeclaration | Yes | No | No |
Reassignment | Yes | Yes | No |
Hoisting | Yes | No | No |
Scope | Function/Global | Block | Block |
Introduced in | 1995 (Since javascript invented)-2015 (still in use but not recommended) | ES 2015 (ES16) 2015 – current | ES 2015 (ES16) 2015 – current |