if / else
Executes code based on a condition.
Syntax
if condition { } else { }Description
Conditions have NO PARENTHESES, { } blocks are mandatory. if is an expression; it can also yield a value.
Example
Loading editor…
Expected output
Passed
When to use?
Flow branching.