falsy¶
Info
New in Atfinity 17.
Description¶
falsy converts a value into a boolean, returning true only for values that clearly represent "false". It is useful when a value comes in as a number or a string (for example from an imported field) and you want to interpret it as a boolean.
falsy returns true for:
- the boolean
false - the number
0 - the strings
"0"and"false"— case-insensitive and trimmed of surrounding whitespace (so" FALSE "also counts)
For any other value it returns false. In particular, numbers other than 0 (such as 2) and unrecognised strings (such as "no" or "maybe") are not falsy.
If the value is unknown, the result is unknown.
Warning
falsy and truthy are not exact opposites. A value like 2 or "maybe" is neither falsy nor truthy — both operators return false for it.