Variables are container to store data.Varriables are :
- must contain letter.
- No number in the first letter.
- Can be Uppercase/lowercase.
- Known as indentifier.
Declaring a variable starts with ” var ” .Follow the code bellow:
<script> var myvariable = 20; //"myvariable" is a variable name whose value is 20 document.write(myvariable);// print the output </script>
Output of the code will: 20
Note: uppercase and lowercase of same word will be different variables. like “Myvariable” and “myvariable” are different variables.