Best practices
Variables
- 1.Always declare an variable with the
var
keyword explicitly-
Variable name can be
- letters: case sensitive
- numbers
- symbols
$
and_
-
Use camelCase for mutable variables: multi-word variable names have the first word in lowercase and the first letter of each subsequent word is capitalized
var anOrdinaryMan
-
-
- Use
const
keywor to name variables you don’t want to reassign
- Use all uppercase letters for immutable variables, with words separated by an underscore.
- Use