Const VS Let VS Var
Background
var happened first , let and const occurs in es6
They are not types, but are keywords, since javaScript is weak and dynamic(check errors after running the program) typed
Const
the value of variable cannot be changed
cannot re-declared
cannot be undefined
Let
Cannot re-declared the variable
Example:
block-scoped
Example:
Var
Function-Scoped
Can be re-declared
Hoisting
Example:
Last updated
Was this helpful?