JavaScript Statements
Statement Identifiers
JavaScript statements start with a statement identifier to identify the action to be performed.
Statement identifiers are reserved words (cannot be used as variable names or any other things).
Complete Statements Reference
Revised July 2025
| Statement | Description |
|---|---|
| { } | Creates an block of statements |
| async function | Creates an AsyncFunction object |
| async function* | Creates an AsyncGeneratorFunction object |
| await using | Declares local variables that are asynchronously disposed |
| break | Exits a switch or a loop |
| class | Declares a class |
| const | Declares a variable with a constant value |
| continue | Breaks one iteration (in the loop) if a specified condition occurs, and continues with the next iteration in the loop |
| debugger | Stops the execution of JavaScript, and calls (if available) the debugging function |
| do...while | Executes a block of statements and repeats the block while a condition is true |
| for | Loops through a block of code a number of times |
| for...in | Loops through the properties of an object |
| for...of | Loops through the values of an iterable object |
| for await...of | Loops over async iterable objects |
| function | Declares a function |
| function* | Creates a GeneratorFunction object |
| if...else...else if | Marks a block of statements to be executed depending on a condition |
| import | Defines a read-only import of a module |
| import attributes | Defines how a module should be loaded |
| let | Declares a variable |
| return | Stops the execution of a function (and returns a value) |
| switch | Marks a block of statements to be executed depending on different cases |
| throw | Throws (generates) an error |
| try...catch...finally | Marks the block of statements to be executed when an error occurs in a try block, and implements error handling |
| using | Declares local variables that are synchronously disposed |
| var | Declares a variable |
| while | Marks a block of statements to be executed while a condition is true |