JavaScript Variable Names

A variable is a named storage location in the computer's RAM memory where you can store data and later retrieve it. A box with a label on it makes a good analogy. When you store something in a box in the closet, you might put a descriptive label on the box to indicate its contents. The name of a variable is kind of like a label, but the box is inside the computer's memory. Of course, when you have lots of boxes (or variables), accurate and descriptive labels help to keep track of what's inside all of them.

The programmer gets to choose the names of variables, but there are rules.

Rules for variable names that are fatal if violated: Non-fatal rules for naming variables: