The break statement
terminates the current loop,
statement and transfers program control to the statement following the terminated statement.
The continue statement terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration.
The debugger statement invokes any available debugging functionality, such as setting a breakpoint. If no debugging functionality is available, this statement has no effect.
do...while statement creates a loop that executes a specified statement until the test condition evaluates to false. The condition is evaluated after executing the statement, resulting in the specified statement executing at least once.
iterates over the enumerable properties
of an object, in arbitrary order. For each distinct property, statements can be executed.
The function declaration defines a function with the specified parameters.
The if statement executes a statement if a specified condition is true. If the condition is false, another statement can be executed.
The labeled statement
can be used with
statements. It is prefixing a statement with an identifier which you can refer to.
return statement ends function execution and specifies a value to be returned to the function caller.
throws a user-defined exception. Execution of the current function will stop (the statements after
won't be executed), and control will be passed to the first
block in the call stack. If no
block exists among caller functions, the program will terminate.
try...catch statement marks a block of statements to try, and specifies a response, should an exception be thrown.
variable statement declares a variable, optionally initializing it to a value.
The while statement creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement.
A block statement (or compound statement in other languages) is used to group zero or more statements. The block is delimited by a pair of curly brackets.
The export statement is used to export functions, objects or primitives from a given file (or module).
The for statement
creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement (usually a block statement
) to be executed in the loop.
The import statement is used to import functions, objects or primitives that have been exported from an external module, another script, etc.
switch statement evaluates an expression, matching the expression's value to a
case clause, and executes statements associated with that case.