Skip to content

toBoolean

toBoolean(value) → boolean · Type

Convert a value to boolean.

  • value (required): string, number, or boolean to convert
utlx
toBoolean("true")                        // true
toBoolean("false")                       // false
toBoolean(1)                             // true
toBoolean(0)                             // false
toBoolean("yes")                         // true
toBoolean("no")                          // false

Released under AGPL-3.0.