Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
37 views

Javascript Boolean Object

The document discusses the JavaScript Boolean object which represents two values - true or false. It lists the properties and methods of the Boolean object including constructor, prototype, toSource, toString and valueOf.

Uploaded by

shivi08
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Javascript Boolean Object

The document discusses the JavaScript Boolean object which represents two values - true or false. It lists the properties and methods of the Boolean object including constructor, prototype, toSource, toString and valueOf.

Uploaded by

shivi08
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

JAVASCRIPT - THE BOOLEAN OBJECT

http://www.tutorialspoint.com/javascript/javascript_boolean_object.htm Copyright tutorialspoint.com

The Boolean object represents two values, either "true" or "false". If value parameter is omitted or
is 0, -0, null, false, NaN, undefined, or the empty string "" , the object has an initial value of false.

Syntax
Use the following syntax to create a boolean object.

var val = new Boolean(value);

Boolean Properties
Here is a list of the properties of Boolean object

Property Description

Returns a reference to the Boolean function that created the object.


constructor

The prototype property allows you to add properties and methods to an


prototype object.

In the following sections, we will have a few examples to illustrate the properties of Boolean object.

Boolean Methods
Here is a list of the methods of Boolean object and their description.

Method Description

Returns a string containing the source of the Boolean object; you can use
toSource this string to create an equivalent object.

Returns a string of either "true" or "false" depending upon the value of the
toString object.

Returns the primitive value of the Boolean object.


valueOf

In the following sections, we will have a few examples to demonstrate the usage of the Boolean
methods.
Loading [MathJax]/jax/output/HTML-CSS/jax.js

You might also like