JavaScript variables can be almost unlimited in length, although for practical reasons you'll probably keep your variable names under 10 or 15 characters. Shorter variable names help JavaScript execute the program faster. You can use numbers as long as the name doesn't start with a digit. For example, MyVar1 is acceptable, but 1MyVar is not. Don't use punctuation characters in variable names.
Variables can begin with the underscore character.
Variable names are case-sensitive. The variable MyVar is a distinctly different variable from myVar, myvar, and other variations. JavaScript internally decodes the variable type based on its content. Using the var statement to assign a variable JavaScript supports a var statement that can be used to explicitly define a variable. The syntax is merely the statement var, a space, and the same variable assignment expression detailed above.