if / elseif / else
Executes code based on a condition.
Syntax
if (condition) { } elseif (condition) { } else { }Description
Condition in parentheses, blocks in { }. Use == for equality or === for strict type checking.
Example
Loading editor…
Expected output
Passed
When to use?
Flow branching, checks.