Skip to main content

Truthy logic

Some functions use transformers to evaluate boolean conditions.

The following table will explain what is the default implicit behavior of resolved values from such transformers:

Value (JSON)Boolean valueComment
BooleanUsed as-is
truetrue
falsefalse
Null
nullfalse
NumberTrue if not zero
1true
-1true
0.1true
0false
StringTrue if not empty (JavaScript style)
""false
"false"trueNotice: we don't use parseBoolean
ObjectTrue if any key exists
{}false
{ "a": false }true
ArrayTrue if length > 0
[]false
[false]true
[null]true
note

Strings behave different when evaluated with $$boolean & $$not (unless specified with JS as style)