coerce.toBool

This function converts the specified value to a boolean.

Syntax

coerce.toBool(value)

Arguments

Argument

Type

Description

value

any

The value to be coerced.

Returns

Type

Description

bool

The coerced bool value

Examples

The function coerce.toBool("true") returns true.