Ein Boolean object stellt jeden möglichen Wert dar, der auswertet, um auszurichten oder falsch. Im großen und ganzen mußt du nicht um den Boolean object dich sorgen, weil die Datenbanksuchroutinen automatisch solche Gegenstände für dich verursachen, wenn du einen zutreffenden oder falschen Wert einer Variable zuweist.
Es gibt Eigenschaft zwei:
1 constructor property
2 prototype property
1 constructor property
This is a reference to the function that created the instance of a Boolean objectthe native Boolean( ) constructor function in browsers.
Example:1
if (myVar.constructor == Boolean)
{
// process native string
}
2 prototype property
It is the property of the static Boolean object. Use the prototype property to assign new properties and methods to future instances of a Boolean value create in the current document.
Example:2
Boolean.prototype.author = "Vyom";
Method
toString( )
valueOf( )
toString( )
Returns the object's value as a string type. We do not 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
valueOf( )
Returns the object's value as a Boolean data type.