Share via


Statements 

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.

In This Section

  • break Statement
    Terminates the current loop, or if in conjunction with a label, terminates the associated statement.
  • Comment Statements
    Causes comments, either single line (//) or multiline (/* */) to be ignored by the JScript parser.
  • do...while Statement
    Executes a statement block once, and then repeats execution of the loop until a condition expression evaluates to false.
  • for Statement
    Executes a block of statements for as long as a specified condition is true.
  • for...in Statement
    Executes one or more statements for each element of an object or array.
  • if...else Statement
    Conditionally executes a group of statements depending on the value of an expression.
  • 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.
  • switch Statement
    Enables the execution of one or more statements when a specified expression's value matches a label.
  • throw Statement
    Generates an error condition that can be handled by a try...catch statement.
  • while Statement
    Executes a statement until a specified condition is false.
  • 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.