@technobuddha > library > Object > Conversion
Function: toBoolean()
ts
function toBoolean(input: string, options: BooleanOptions): undefined | boolean;Defined in: to-boolean.ts:36
Convert a string to a boolean value
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | The string to convert |
options | BooleanOptions | see BooleanOptions |
Returns
undefined | boolean
Default Value
ts
trueValues 'true', 'yes', 'y', 'on', or '1'Default Value
ts
falseValues 'false', 'no', 'n', 'off', '0'