JavaScript boolean.constructor Property

Shubham Vora Jan 30, 2023
  1. Syntax of JavaScript boolean.constructor Property
  2. Use the boolean.constructor Property in JavaScript
JavaScript boolean.constructor Property

In JavaScript, the boolean.constructor property returns the function that created this prototype.

Syntax of JavaScript boolean.constructor Property

boolean.constructor;

Parameter

JavaScript boolean.constructor property has no parameters.

Return

JavaScript boolean.constructor property returns the function that created its prototype.

Use the boolean.constructor Property in JavaScript

In JavaScript, the boolean.constructor method gives the function that created its prototype. Below we have created an object and used the boolean.constructor property.

var boolean = new Boolean( );
console.log(boolean.constructor);

Output:

function Boolean() { [native code] }

The boolean.constructor method is supported in most browsers.

Author: Shubham Vora
Shubham Vora avatar Shubham Vora avatar

Shubham is a software developer interested in learning and writing about various technologies. He loves to help people by sharing vast knowledge about modern technologies via different platforms such as the DelftStack.com website.

LinkedIn GitHub

Related Article - JavaScript Boolean