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
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