- Part 1: Let and Const
- Part 2: Template Literals
- Part 3: Default Parameter Values
- Part 4: Arrow Functions
- Part 5: Classes
Let and Const
ES6 changes things. It introduces two new keywords: let and const. Now, instead of using var, these new keywords can be used to describe the mutability of the values.
If the value of a variable might change, the keyword let can be used. It takes the place of var and describes something that can or will change. It is mutable.
If the value of a variable will not change, the keyword const can be used. Its value is a constant once created. It is immutable.
Let or Const?