contents   index   previous   next



global.ToBoolean()

syntax:

ToBoolean(value)

where:

value - to be cast as a boolean.

 

return:

boolean - conversion of value.

 

description:

The following list indicates how different data types are converted by this function.

 

Boolean
same as value

Buffer
same as for String

null
false

Number
false, if value is 0, +0, -0 or NaN, else true

Object
true

String
false if empty string, "", else true

undefined
false

 


global.ToBuffer()