Do | Don’t |
---|---|
Use variable names that start with a letter, $, or _ | Use variable names that start with a number |
Use variable names that include letters, numbers, $ or _ | Create variable names that include a “-”, “.” or space |
Use “lower camel case” when creating variable names made up of more than one word, for example: firstName | Create variable names that use reserved Javascript keywords such as let, var, function or switch |
Variables names should describe the kind of information the variable stores
Here’s a list of Javascript’s reserved keywords