Version: v0.8.0 - Beta.  We welcome contributors & feedback.

Number.toBoolean

toBoolean() -> boolean

Description

Convert to Boolean type.

A value of 0 is false. All other values return true.

$num1 = 1.23
$num1.toBoolean()
//= true

$num2 = 0
$num2.toBoolean()
//= false

See Also