Statements

Statements are a single instruction. A statement is the smallest standalone unit of execution. JS++ programs are composed of statements. JS++ statements consist of keyword(s) and their respective syntax. Statements are terminated with semicolons except for declarations (e.g. class and interface declarations) and blocks.

  • auto

    Declares a variable using local-variable type inference.

  • Block

    Blocks are used to group multiple statements together.

  • break

    Exits the current loop, switch case or default clause, or labeled statement. Program will continue executing from the statement following the exited statement.

  • class

    Declares a class.

  • continue

    Exits the current loop iteration and skips to the next loop iteration. If no loop iterations remain, the program will continue executing from the statement following the exited loop.

  • debugger

    Suspends execution and invokes the debugger. If a debugger is not available, this statement does nothing.

  • do...while

    A do...while loop is used to repeatedly execute code as long as a given condition is true. The condition is evaluated after the statement so, in a do...while loop, the statement is always executed at least once.

  • Empty Statement

    An empty statement will do nothing. It can be used anywhere a statement is expected.

  • enum

    Declares an enumeration.

  • external

    Imports symbols from JavaScript. If declared with an initializer, the external keyword declares a variable with type external and initialized to an arbitrary value.

  • for

    The for loop is used for iteration and allows statements to be executed repeatedly. A for loop is a loop that can be used with a counter variable.

  • for...in

    Iterates over an object's own enumerable properties including the properties inherited from its prototype. Statements can be executed for each enumerable property.

  • foreach

    Iterates over an object's own enumerable properties but not properties inherited from its prototype. Statements can be executed for each enumerable property.

  • function

    Declares a function with a return type of the external type.

  • Function Declaration

    Declares a function.

  • if...else

    The if statement will execute statements when its condition evaluates to true. Optionally, it will execute the statements in its else clause if its condition evaluates to false.

  • import

    Imports a module.

  • interface

    Declares an interface.

  • label

    A label can be applied to a statement to give it a name; this name can later be referred to from 'break' and 'continue' statements.

  • module

    Declares an importable module. Modules enable you to organize code and prevent naming conflicts.

  • return

    Exits a function and, optionally, evaluates an expression and returns the evaluated expression to the function's caller.

  • switch

    Evaluates an expression, matches its result against one or more case expressions, and executes statements for the corresponding case.

  • throw

    Throws a user-defined exception.

  • try/catch/finally

    Attempts to execute a block of statements and specifies a response if an exception is thrown.

  • var

    Declares a variable with the external type. The variable can optionally be initialized to a value.

  • Variable Declaration

    Declares a variable. The variable can optionally be initialized to a value.

  • while

    A while loop is used to repeatedly execute code as long as a given condition is true.

  • with

    Specifies a default object for a statement.

Share

HTML | BBCode | Direct Link