Difference between var and let keyword
- Keyword “var”
- In JavaScript programming, the “var” keyword has been used from the very initial stages of JavaScript.
- We can perform functions with the help of the keyword “var’ by accessing various variables.
- Keyword “let”
- The Keyword “let” was added later in ECMAScript 2015 in JavaScript Programming.
- Variable declaration is very limited with the help of the “let” keyword that is declared in Block. Also, it might result in a ReferenceError as the variable was declared in the “temporal dead zone” at the beginning of the block.
