Modern JavaScript
Defining variables
- Do not use
var- it is not scoped to blocks (effectively it is a global variable) and it can be redefined - Use
constfor values which should not change (remember that properties of the object *can* change, even though the object pointed to cannot) - Use
letfor values which may change