Visit Mozilla.org

Core JavaScript 1.5 Guide:Predefined Core Objects:Boolean Object

From MDC


[edit] Boolean Object

The Boolean object is a wrapper around the primitive Boolean data type. Use the following syntax to create a Boolean object:

booleanObjectName = new Boolean(value)

Do not confuse the primitive Boolean values true and false with the true and false values of the Boolean object. Any object whose value is not undefined , null, 0, NaN, or the empty string , including a Boolean object whose value is false, evaluates to true when passed to a conditional statement. See if...else Statement for more information.

« Previous Next »