Boolean Object
CSGNetwork FREE Source Code, Javascript Source, and Code Snippets!
CSGNetwork Custom Search
     Bookmark and Share
 
CSGNetwork
Snippets
Calculators
Top Free Apps
Home
Back



Right click this window and select "view source" in order to copy the source for this script.

Boolean Object

The Boolean object is an object wrapper for a boolean (true or false) value. You can explicitly define a Boolean via:

new Boolean([value])

1) Value- Initial value of the Boolean object. The value is converted to a boolean value, if necessary. If value is not specified, 0, -0, null, false, NaN, undefined, or the empty string (""), the object is set to false. All other values, including any object or the string "false", create an object with a value of true.

For example:

var guess=new Boolean(false) //false value
var guess=new Boolean(0) //false value
var guess=new Boolean(true) //true value
var guess=new Boolean("whatever") //true value

Properties

Properties Description
constructor Specifies the function that created the object's prototype.
prototype Allows you to define properties on the Boolean that is shared by all Boolean objects.

Methods

Methods Description
toString() Returns a string specifying the value of the Boolean, in this case, "true" or "false."
valueOf() Returns the primitive value of a Boolean object.


Bookmark and Share
Registered® Trademark™ and Copyright© 1973 - CSG, Computer Support Group, Inc. and CSGNetwork.Com All Rights Reserved