Javatpoint Logo
Javatpoint Logo

JavaScript Boolean

JavaScript Boolean is an object that represents value in two states: true or false. You can create the JavaScript Boolean object by Boolean() constructor as given below.

The default value of JavaScript Boolean object is false.

JavaScript Boolean Example

JavaScript Boolean Properties

constructorreturns the reference of Boolean function that created Boolean object.
prototypeenables you to add properties and methods in Boolean prototype.

JavaScript Boolean Methods

toSource()returns the source of Boolean object as a string.
toString()converts Boolean into String.
valueOf()converts other type into Boolean.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA