Skip to content

If and If Else Statements

Michael edited this page Mar 29, 2021 · 1 revision

If and If/Else Statements

If statements take the following form:

if (condition) (result)

Note: if the condition for if is false, nothing is returned.

Examples:

Enter Code: if (true) (1)
Time: <1ms
Result: 1
Enter Code: if (false) (2)
Time: <0ms
Result:

If/else statements take the following form:

ifl (condition) (trueresult) else (falseresult)

Examples:

Enter Code: ifl (true) (1) else (2)
Time: <2ms
Result: 1
Enter Code: ifl (false) (1) else (2)
Time: <0ms
Result: 2