Control Flow
Parentheses and Braces
Curly braces {
}
are required for all control flow. The parentheses (
)
are optional.
For
While
Until
When
If
Ternary operator
Goto
By default goto
is disabled by the compiler. This can be enabled in build.toml
.
From xkcd.
Continue and Break
Labelled Blocks
Block Values
Blocks are expressions and can be used to get values.
Sometimes it's impracticle or not possible to initialize/set a variable in one line. Using blocks can prevent needing to set the variable to undefined or a temporary value.
Blocks can be labbeled as well to return a value from a specified block if nested.