JavaScript Boolean constructor Property

The Boolean constructor property returns the constructor function that created the Boolean prototype −

Following is the code for JavaScript Boolean constructor property −


 Live Demo

<!DOCTYPE html>
   body {
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
<h1>JavaScript Boolean constructor Property</h1>
<p class="sample"></p>
<button class="btn">CLICK HERE</button>
<h3>Click on the above button to get the boolean constructor function</h3>
   var bool = true;
   document.querySelector(".btn").addEventListener("click", () => {
      document.querySelector(".sample").innerHTML =
      "The boolean constructor function: <br>" + bool.constructor;


On clicking the “CLICK HERE” button −