WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

JavaScript Boolean Reference


JavaScript Booleans

JavaScript booleans can have one of two qualities: true or false.


The Boolean() Function

You can utilize the Boolean() capacity to see whether an articulation is true:

Example

Boolean(10 > 9)       //returns genuine
Try it Yourself »

Or even easier:

Example

(10 > 9)             / likewise returns true
10 > 9               / likewise returns genuine
Try it Yourself »

For an instructional exercise about booleans, read our JavaScript Boolean Tutorial.


Boolean Properties

Property Description
constructor Returns the capacity that made JavaScript's Boolean prototype
prototype Allows you to add properties and techniques to the Boolean prototype

Boolean Methods

Method Description
toString() Converts a boolean incentive to a string, and returns the result
valueOf() Returns the crude estimation of a boolean