boolean
Converts the input to a boolean.
boolean
Converts the input to a boolean.
Type: transform
Aliases
toBoolean
, bool
, boolean
, toBool
Parameters
- input (unknown): The input to convert to a boolean.
Returns
Type: boolean
The boolean value, or undefined for ambiguous string values.
Examples
toBoolean("true") // true
"false"|toBoolean // false
toBoolean(1) // true