Scripting reference · Nerdamer Language
if
Returns one of two values, depending on a condition.
Only the chosen branch is evaluated, so an error or assignment in the other one never happens.
The false branch is optional. Without it, a false condition gives no value, so use that form for a step that only sometimes runs, inside block.
Scripting
if(condition, whenTrue, whenFalse)
Write it in a script: nerdamer('if(1,5,6)'), or in the Playground.
Parameters
condition- Decides which branch runs.
whenTrue- The value when the condition is true.
whenFalse- Optional. The value when it is false.
Examples
Good to know
- A value is true when it isn't zero. An unknown symbol counts as true; a comparison that can't be decided, such as
x>0for an unknownx, counts as false.
Deprecated names
Deprecated.
IF still works, and gives the same result as if, but each call records an api.deprecatedFunction warning. Use if instead; the old name will be removed in a later major version.
