Boolean | NN 3 IE J2 ECMA 1 |
A Boolean object represents any value that evaluates to true or false. By and large, you don't have to worry about the Boolean object because the browsers automatically create such objects for you when you assign a true or false value to a variable. | |
Creating a Boolean Objectvar myValue = new Boolean() var myValue = new Boolean(BooleanValue) var myValue = BooleanValue |
prototype | NN 3 IE J2 ECMA 1 |
Read/Write | |
A property of the static Boolean object. Use the prototype property to assign new properties and methods to future instances of a Boolean value created in the current document. See the Array.prototype property description for examples. There is little need to create new prototype properties or methods for the Boolean object. | |
ExampleBoolean.prototype.author = "DG" | |
Value Any data, including function references. |
toString() | NN 4 IE J3 ECMA 1 |
Returns the object's value as a string data type. You don't need this method in practice, because the browsers automatically convert Boolean values to strings when they are needed for display in alert dialogs or in-document rendering. | |
Returned Value "true" | "false" | |
Parameters None. |
valueOf() | NN 4 IE J3 ECMA 1 |
Returns the object's value as a Boolean data type. You don't need this method when you create Boolean objects by simple value assignment. | |
Returned Value Boolean value: true | false. | |
Parameters None. |