What are Variables?
Variables are containers for storing data (storing data values).
- If you want your code to run in older browsers, you must use
- If you want a general rule: always declare variables with
- If you think the value of the variable can change, use
These unique names are called identifiers.
The general rules for constructing names for variables (unique identifiers) are:
- Names can contain letters, digits, underscores, and dollar signs.
- Names must begin with a letter.
- Names can also begin with $ and _ (but we will not use it in this tutorial).
- Names are case sensitive (y and Y are different variables).