- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 −
Example
<!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>
Output
On clicking the “CLICK HERE” button −
- Related Articles
- JavaScript Date constructor Property
- Add a property to a JavaScript object constructor?
- How to add a property, method to a JavaScript constructor?
- Constructor Property Promotion in PHP 8
- Boolean Gates in JavaScript
- JavaScript Array prototype Constructor
- JavaScript's Boolean function?
- JavaScript -Short-circuiting in boolean
- What is JavaScript Error Constructor?
- JavaScript Convert a string to boolean
- What is function() constructor in JavaScript?
- How [ ] is converted to Boolean in JavaScript?
- How to declare boolean variables in JavaScript?
- How to declare a boolean in JavaScript?
- How to toggle a boolean using JavaScript?

Advertisements