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. autoDeclares a variable using local-variable type inference. BlockBlocks are used to group multiple statements together. breakExits the current loop, switch case or default clause, or labeled statement. Program will continue executing from the statement following the exited statement. classDeclares a class. continueExits 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. debuggerSuspends execution and invokes the debugger. If a debugger is not available, this statement does nothing. do...whileA 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 StatementAn empty statement will do nothing. It can be used anywhere a statement is expected. enumDeclares an enumeration. externalImports symbols from JavaScript. If declared with an initializer, the external keyword declares a variable with type external and initialized to an arbitrary value. forThe 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...inIterates over an object's own enumerable properties including the properties inherited from its prototype. Statements can be executed for each enumerable property. foreachIterates over an object's own enumerable properties but not properties inherited from its prototype. Statements can be executed for each enumerable property. functionDeclares a function with a return type of the external type. Function DeclarationDeclares a function. if...elseThe 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. importImports a module. interfaceDeclares an interface. labelA label can be applied to a statement to give it a name; this name can later be referred to from 'break' and 'continue' statements. moduleDeclares an importable module. Modules enable you to organize code and prevent naming conflicts. returnExits a function and, optionally, evaluates an expression and returns the evaluated expression to the function's caller. switchEvaluates an expression, matches its result against one or more case expressions, and executes statements for the corresponding case. throwThrows a user-defined exception. try/catch/finallyAttempts to execute a block of statements and specifies a response if an exception is thrown. varDeclares a variable with the external type. The variable can optionally be initialized to a value. Variable DeclarationDeclares a variable. The variable can optionally be initialized to a value. whileA while loop is used to repeatedly execute code as long as a given condition is true. withSpecifies a default object for a statement. yieldPauses and exits a function and, optionally, evaluates an expression that can be accessed via the ISequence.value method. Share HTML | BBCode | Direct Link