Variable names cannot contain spaces.
Variable names must begin with a letter, an underscore (_) or a dollar sign ($).
Variable names can only contain letters, numbers, underscores, or dollar signs.
Variable names are case-sensitive.
You’ll be faced with many decisions when choosing how to name your variables: Do you want to begin your variable names with an uppercase letter or a lowercase letter, or do you want to use camelCase? Do you want to use multiple words within your variable names? Do you want to use an underscore (_) between the words in your variable name? (Remember: Variables can’t contain spaces.)
Fortunately, you don’t have to make all these choices by yourself. Many professional programmers agree that there are best practices to keep in mind when naming your variables:
Don’t use names that are too short. Simple one-letter names or names that don’t make sense are not a good option when naming variables.
Use more than one word to name your variable. This will ensure your variable name is precise.
When using more than one word in your variable names, always put the adjective to the left. For example, this is correct: var greenGrass.