Export (0) Print
Expand All
5 out of 8 rated this helpful - Rate this topic

JavaScript Statements

The following table lists JavaScript statements.


Language Element

Terminates the current loop, or if in conjunction with a label, terminates the associated statement.

break Statement

Contains statements to execute when an error occurs in code within the try block.

catch Statement

Activates conditional compilation support.

@cc_on Statement

Causes comments to be ignored by the JavaScript parser.

Comment Statements

Declares a block-scoped variable with a constant value.


Stops the current iteration of a loop, and starts a new iteration.

continue Statement

Starts the debugger.

debugger Statement

Executes a statement block once, and then repeats execution of the loop until a condition expression evaluates to false.

do...while Statement

Executes a block of statements for as long as a specified condition is true.

for Statement

Executes one or more statements for each element of an object or array.

for...in Statement

Declares a new function.

function Statement

Conditionally executes a group of statements, depending on the value of an expression.

@if Statement

Conditionally executes a group of statements, depending on the value of an expression.

if...else Statement

Provides an identifier for a statement.

Labeled Statement

Declares a block-scoped variable.


Exits from the current function and returns a value from that function.

return Statement

Creates variables used with conditional compilation statements.

@set Statement

Enables the execution of one or more statements when a specified expression's value matches a label.

switch Statement

Refers to the current object.

this Statement

Generates an error condition that can be handled by a try...catch statement.

throw Statement

Implements error handling for JavaScript.

try Statement

Declares a variable.

var Statement

Executes a statement until a specified condition is false.

while Statement

Establishes the default object for a statement.

with Statement

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.