Variables are containers for storing value. Their value can be changed over time.
We can easily declare a variable by using var.
var x = 10;
In this, we assign x the value of 10. The "=" sign is called the assignment operator.
- The first character of a variable name must be a letter, underscore (_), or a dollar sign ($).
- The first character of a variable name can’t be a number.
- Variable names can’t include a mathematical or logical operator in their name.
- Variable names can’t contain spaces.
- Variable names can't allow special symbols