This documentation is archived and is not being maintained.


A statement is a piece of JScript code that performs an action. Some statements declare user-defined elements, such as variables, functions, classes, and enumerations, while other statements control program flow. The following sections link to information that explains how to use statements in JScript.

break Statement

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

class Statement

Defines a class and the members of that class.

@cc_on Statement

Activates conditional compilation support.

Comment Statements

Causes comments, either single line (//) or multiline (/* */) to be ignored by the JScript parser.

const Statement

Defines a constant identifier and its value.

continue Statement

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

debugger Statement

Launches the installed debugger.

do...while Statement

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

enum Statement

Declares an enumeration and the enumeration values.

for Statement

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

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

function Statement

Declares a new function.

function get Statement

Declares the setter for a property.

function set Statement

Declares the getter for a property.

@if...@elif...@else...@end Statement

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

if...else Statement

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

import Statement

Enables access to external library.

interface Statement

Declares an interface and the members of the interface.

Labeled Statement

Provides an identifier for a statement.

package Statement

Provides a way to package classes and interfaces in named components.

print Statement

Provides a way to display information from a program run from the command line.

return Statement

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

@set Statement

Creates variables used with conditional compilation statements.

static Statement

Declares a block of code that initializes a class.

super Statement

Refers to the base class of the current object.

switch Statement

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

this Statement

Refers to the current object.

throw Statement

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

try...catch...finally Statement

Implements error handling for JScript.

var Statement

Declares a variable.

while Statement

Executes a statement until a specified condition is false.

with Statement

Establishes the default object for a statement.

JScript Reference

Lists elements that comprise JScript Language Reference and links to topics that explain the details behind the proper use of language elements.

.NET Framework Reference

Lists links to topics that explain the syntax and structure of the .NET Framework class library and other essential elements.