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. JavaScript imposes a limit of 254 characters for each string variable assignment in your program.