Skip to content

boolean ​

Checks that the value is a boolean, 1, 0, or one of the strings "1", "0", "true" and "false", and returns a real boolean.

Error codes: NOT_BOOLEAN, FORMAT_ERROR

Live example · edit rules or inputOpen in playground
rules
input
Invaliderrors
{
  "subscribe": "NOT_BOOLEAN"
}
InputOutput
true, 1, "1", "true"true
false, 0, "0", "false"false

Any other primitive value gives NOT_BOOLEAN. Strings are case-sensitive: "True" gives NOT_BOOLEAN.