JavaScript Variables:
var myVar;
All lines in JS must end with a semi-colon, to
indicate that this is where the line ends. If you don't include these, you can
get unexpected results.
You can call a variable nearly anything, but there are
some name restrictions.
JavaScript is case sensitive — myVar is a
different variable to myvar. If you are getting problems in your code,
check the casing.
After declaring a variable, you can give it a value of declared javascript variable:
myVar = 'deep';
You can retrieve the value by just calling the variable by
name:
myVar;
You can do both these operations on the same line if you
wish:
var myVar = 'deep';
No comments:
Post a Comment