coerce.to-boolean

coerce.to-boolean attempts to coerce an unknown datum to a boolean type.

Function category: Coercion

Syntax

coerce.to-boolean(arg1)

Arguments

Description

arg1

Any datum.

Examples

Example 1: "true"/"false" strings

coerce.to-boolean coerces the string value of 'true' to true and the string value of 'false' to false.

coerce.to-boolean("true") = true
coerce.to-boolean("false") = false

Example 2: Other strings

For any other strings, coerce.to-boolean will return null.

coerce.to-boolean("test") = null

Notes