JavaScript statements often start with a statement identifier
to identify the JavaScript action to be performed.
Statement identifiers are reserved words and cannot be used as variable names
(or any other things).
Here is a list of some of the JavaScript statements (reserved words) you will learn about in
this tutorial:
| Statement | Description |
|---|---|
| break | Terminates a switch or a loop. |
| catch | Marks the block of statements to be executed when an error occurs in a try block. |
| continue | Jumps out of a loop and starts at the top. |
| do ... while | Executes a block of statements and repeats the block while a condition is true. |
| for | Marks a block of statements to be executed as long as a condition is true. |
| for ... in | Marks a block of statements to be executed for each element of an object (or array). |
| function | Declares a function. |
| if ... else | Marks a block of statements to be executed depending on a condition. |
| return | Exits a function. |
| switch | Marks a block of statements to be executed depending on different cases. |
| throw | Throws (generates) an error. |
| try | Implements error handling to a block of statements. |
| var | Declares a variable. |
| while | Marks a block of statements to be executed while a condition is true. |






0 komentar:
Posting Komentar