B Boolean object (Object/core) (Ecommerce web host) Boolean object (Object/core)
B Boolean object (Object/core) Boolean object (Object/core) An object of the class “Boolean”. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 3.0 Internet Explorer 4.0 Netscape 3.0 Netscape Enterprise Server 2.0 Opera 3.0 -myBoolean = BooleanValue -myBoolean = new Boolean() JavaScript syntax: -myBoolean = new Boolean(aValue) BooleanValue A Boolean value (either true or false) Argument List aValue A value to be converted to a Boolean object. Object properties: constructor, prototype Object methods: toSource(), toString(), valueOf() An instance of the class “Boolean” is created by using the new operator on the Boolean() constructor. The new object adopts the behavior of the built-in Boolean prototype object through the prototype-inheritance mechanisms. All properties and methods of the prototype are available as if they were part of the new instance. A Boolean object is a member of the type Object and is an instance of the built-in Boolean object. Cloning the built-in Boolean object creates Boolean objects. This is done by calling the Boolean()constructor with the newoperator. For example: myBoolean = new Boolean(true); A Booleanobject can be coerced into a Boolean value and can be used anywhere that a Boolean value would be expected. Programmers familiar with object-oriented techniques may be happy to use the Boolean object, while procedural language programmers may prefer to implement the same functionality with a Boolean value instead. This is an example of the flexibility of JavaScript in its ability to accommodate a variety of users from different backgrounds. The prototype for the Boolean prototype object is the Object prototype object. See also: Boolean. prototype, Native object, Object object, unwatch(), watch()