Name

boolean( )

Synopsis

                     boolean boolean(object o)

The boolean() function converts its argument to a Boolean according to these rules:

  • Zero and NaN are false. All other numbers are true.

  • Empty node-sets are false. Nonempty node-sets are true.

  • Empty strings are false. Nonempty strings are true.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.