Variables and Naming Rules
- Variables can be used to hold values [e.g.: (x=10) or expression (a=b+c)].
- Can have short names (like x and y) or more descriptive names (age, sum total volume)
- Declared using the keyword var.
Rule For Naming Variables
- Names must begin with a letter.
- Names can also begin with $ and _.
- Variable names are case sensitive ( Y and y are different variables).
Multiple Variable Declaration
Variable initialization can be done in two ways:
- At the time of variable declaration
- At the later point when the variable is required