Variables in JavaScript are defined by using the var operator (short for variable), followed by the variable name, such as: | |
| |
In this example, the variable test is declared and given an initialization value of "hi" (a string). | |
You can also define two or more variables using the same var statement: | |
| |
Variables using the same var statement don't have to be of the same type: | |
| |
variables in JavaScript do not require initialization: | |
|