Statements
Following types of statements are supported by JSX. The differences from JavaScript are:
- a block cannot have a label
- constructor invocation statements have been introduced
- delete is a statement instead of an expression
- argument of catch clause can be typed, and thus the clause is nestable
Statement | Description |
---|---|
|
empty statement |
|
block statement |
|
evaluates the expr |
|
returns void |
|
returns the result of the expr |
|
throw an error object which can be caught by try statement |
|
displays expr to the console. log statements will be removed on release build |
|
throws a runtime error if expr is failsy with message or "assertion failure" . assert statements will be removed on release build |
|
stops running and starts a debugger if available |
|
deletes the property of a Map returned by the expr |
|
calls the constructor of the class (this can be used to refer to the current class, super can be used for referring to the super class) |
|
if statement |
|
variable declaration |
|
exits from the inner-most loop or switch statement |
|
exits to the loop or switch statement with label LABEL |
|
skips to the end of the loop statement |
|
skip to the end of the loop statement with label LABEL |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allowed only inside switch statements |
|
allowed only inside switch statements |
|
catch statement can be nested |
|