var varname [= value];
Let’s see some examples
That’s it. Isn’t it simple.
var count = 34; count = 100.24
Now let’s discuss about the naming. You can give the names of the variables in the following manner
Is the above declaration clear to you? Those of you who are not familiar with this declaration. It means the following.
A declaration needs to be of length one or more.
The first character can be any of these: $, _, any character from a to z or A to Z
The remaining characters can be any numeral 0-9, $, _, any character from a to z or A to Z.
So the following variables are correct
$, _, a, b, A, $A, _a, a0e, name
Let’s see more on assignment of variables.