Boolean Class Reference
[ECMAScript/QtScript - Native Objects]

ECMAScript Boolean prototype object. More...

Inheritance diagram for Boolean:

Object List of all members.

Public Member Functions

Methods
String toString ()
Number valueOf ()

Detailed Description

ECMAScript Boolean prototype object.

ECMAScript provides a Boolean data type that can have one of two primitive values, true or false. In general, creating objects of this type is not recommended since the behavior will probably not be what you would expect. Instead, assign the literal value true or false as required.

Any expression can be evaluated in a boolean context (e.g. in logical operations, such as conditionals). If the expression's value is 0, null, false, NaN, undefined or an empty String, the expression is false; otherwise the expression is true.

Example:
Creating boolean values using the true/false constants
    var bOn = true;
    var bOff = false;

Example:
Creating a boolean values using the evaluation of expressions
    var nVal1 = 5;
    var nVal2 = 6;
    var bEqual = (nVal1 == nVal2);
    var bLessThan = (nVal1 < nVal2);
    var bGreaterThan = (nVal1 > nVal2);


Member Function Documentation

String Boolean::toString (  ) 

Returns:
The value of the Boolean object as a String; i.e. "true" or "false".

Reimplemented from Object.

Number Boolean::valueOf (  ) 

Returns:
The primative value of the Boolean object; i.e. true or false.

Reimplemented from Object.


Generated on Thu Sep 24 12:21:10 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.