बूलियन कंस्ट्रक्टर प्रॉपर्टी बूलियन प्रोटोटाइप बनाने वाले कंस्ट्रक्टर फ़ंक्शन को लौटाती है -
JavaScript बूलियन कंस्ट्रक्टर प्रॉपर्टी के लिए कोड निम्नलिखित है -
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
</style>
</head>
<body>
<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>
<script>
var bool = true;
document.querySelector(".btn").addEventListener("click", () => {
document.querySelector(".sample").innerHTML =
"The boolean constructor function: <br>" + bool.constructor;
});
</script>
</body>
</html> आउटपुट

"यहां क्लिक करें" बटन पर क्लिक करने पर -
