[Link].
me
JAVASCRIPT
STATEMENTS
JavaScript statements are composed of:
Values, Operators, Expressions, Keywords,
and Comments.
THIS STATEMENT TELLS THE BROWSER TO WRITE "HELLO DOLLY." INSIDE AN
HTML ELEMENT WITH ID="DEMO":
Most JavaScript
programs
contain many
JavaScript
statements.
The statements
are executed,
one by one, in
the same order
as they are
written.
SEMICOLONS ;
Semicolons separate JavaScript statements.
Add a semicolon at the end of each
executable statement:
JAVASCRIPT WHITE SPACE
JavaScript ignores multiple spaces.
You can add white space to your script
to make it more readable.
A good practice is to put spaces around
operators ( = + - * / ):
JAVASCRIPT LINE
LENGTH AND LINE BREAKS
For best readability, programmers often like
to avoid code lines longer than 80 characters.
If a JavaScript statement does not fit on one
line, the best place to break it is after an
operator:
JAVASCRIPT CODE BLOCKS
JavaScript statements can be grouped
together in code blocks, inside curly
brackets {...}.
The purpose of code blocks is to define
statements to be executed together.
One place you will find statements grouped
together in blocks, is in JavaScript
functions:
JAVASCRIPT KEYWORDS
JavaScript statements often start with a
keyword to identify the JavaScript action
to be performed.
Here is a list of some of the keywords you
will learn about in this tutorial:
JAVASCRIPT RESERVED WORDS
In JavaScript you cannot use these reserved
words as variables, labels, or function names: