|
| JAVASCRIPT SYNTAX
Like any other programming language, javascript also has a set of syntax rules that need to be followed for error-free programming. These are:
Terminate statements with semi-colon
alert('Hello World');
Reserved words and in-built function names are lowercase
alert('Hello World'); is right
ALERT('Hello World'); is wrong
All whitespace is ignored
var name="John";
alert('Hello World');
is the same as:
var name="John";alert('Hello World');
Commenting scripts is allowed
// short comments
\* This can be used if your comments are very long and go over multiple lines */
|
|