How to use a Boolean in JavaScript Constructors?

JavascriptWeb DevelopmentFront End Technology

To use Boolean in JavaScript constructors, use JavaScript boolean constructor() method. It returns a reference to the Boolean function that created the instance's prototype.


You can try to run the following code to learn how to use Booleans in Constructors

Live Demo

      <title>JavaScript constructor() Method</title>

         var bool = new Boolean( );
         document.write("bool.constructor() is:"+bool.constructor);
Updated on 13-Jan-2020 08:21:50