1: var
2: let
3: const
Let vs const
Let: mutated later it can be changed (function scope). The let value only limit to the block of code so if we change a pet value it only changes inside the block of code.
Var: it is a global scope and works everywhere.
Const: the assigned value can not be changed

0 Comments