JavaScript Programmer’s Reference Boolean() (Function) A Boolean object (Shared web hosting)
JavaScript Programmer’s Reference Boolean() (Function) A Boolean object constructor. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 3.0 Internet Explorer 4.0 Netscape 3.0 Property/method value type: Boolean primitive -Boolean() JavaScript syntax: -Boolean(aValue) Argument list: aValue A value to be converted to a Boolean result When the Boolean() constructor is called as a function, it performs a type conversion on the value that is passed to it as a parameter. The following results are yielded by the Boolean() constructor function: false No value Value: Result: undefined false null false Boolean false false Boolean true true NAN false false Non zero number true Zero length string “” false Non zero length string true true The result will be trueor falsedepending on the parameter’s value. If the parameter value is omitted, then false is returned by default. Object See also: Cast operator, Constructor function, constructor property, Implicit conversion, Type conversion Cross-references: ECMA 262 edition 2 section 15.1.3.5 ECMA 262 edition 2 section 15.6.1 ECMA 262 edition 2 section 15.6.2 ECMA 262 edition 2 section 15.6.3 ECMA 262 edition 3 section 15.6.1