Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

Number.toBoolean

toBoolean()

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