EchoEcho.Com Homepage
Web Hosting - As Reliable As It Gets!
   Home > References > JavaScript > Boolean Object


 Tutorials 
 D-Zine Articles 
 Online Tools 
 Free Resources 
 References 
 Quiz 
 Hosting 

















  JavaScript Objects :
BOOLEAN OBJECT








Core ObjectNNIEECMA
 Boolean Variable representing true or false.2+4+ECMA 1
 
MethodsNNIEECMA
 toSource() String representing the source code of the object.4+n/an/a
 toString() Returns boolean value as string type.2+4+ECMA 1
 valueOf() Returns an objects value as a Boolean type.2+4+ECMA 1
 
PropertiesNNIEECMA
 constructor Reference to the function that created an object.2+4+ECMA 1
 prototype Creates a new method for Boolean objects2+4+ECMA 1





 Boolean Core object 
 Variable representing true or false.
 
Syntax:

Syntax 1
  var myBoolean = new Boolean()


Syntax 2
  var myBoolean = new Boolean(booleanValue)


Syntax 3
  var myArray = booleanValue

 
Browser support:
 Microsoft Internet Explorer: 4+
 Netscape Browser: 2+
 
Implementations:
 JavaScript 1.1 (by Netscape)
 JScript 2 (by Microsoft)
 ECMA Script 1 (ECMA Standard)
 
 
Example:

Example 1 :

  var myBoolean = false;
  alert(myBoolean);


Example 2 :

  var myBoolean = false;
  var yourBoolean = true;
  if (myBoolean) alert('myBoolean is true');
  if (yourBoolean) alert('yourBoolean is true');



















DEVELOPER TIP!
FACT:
Most free graphic sites offer graphics that you can browse at random.
TIP:
Our online tool lets you select each of our 3000 graphics in any color you want.
And you can see how backgrounds, buttons and dividers work together at the same time.





     "Better Than Books - As Easy As It Gets!"


On EchoEcho: D-Zine Articles | Tutorials | Online Tools | Free Resources | References | Quiz | HostingAbout EchoEcho