Truthy and Falsy
In programming, anything that returns true
in a conditional is called truthy. Anything that returns false
in a conditional is called falsy. All object types can be described as either truthy or falsy.
All values in ZML are truthy except
nil
andfalse
. Strings, even when empty, are truthy.The falsy values in ZML are
nil
andfalse
.
Summary
The table below summarizes what is truthy or falsy in ZML.
Truthy | Falsy | |
---|---|---|
true | • | |
false | • | |
nil | • | |
string |
| |
empty string |
| |
0 | • | |
integer |
| |
float |
| |
array |
| |
empty array |
| |
page |
| |
EmptyDrop |
|