-
Notifications
You must be signed in to change notification settings - Fork 0
iff
Maxime Labelle edited this page Feb 11, 2025
·
4 revisions
any iff(any, any, any)
The first expression is considered a predicate, that is, an expression that evaluates to either true
or false
.
Depending on the result of evaluating the predicate expression, the iff
function returns the evaluation of its second expression if true
, otherwise it returns the evaluation of its third expression.
Given | Expression | Result |
---|---|---|
iff(`true`, `true`, `false`) |
true |
|
iff(` false` , ` true` , ` false` ) |
false | |
{ "eval": true, "true": "truthy", "false": "falsy" } |
iff(eval, true, false) |
"truthy" |
{ "eval": false, "true": "truthy", "false": "falsy" } |
iff(eval, true, false) |
"falsy" |