Description

The JavaScript Boolean property constructor returns the function that created the Boolean prototype.

Syntax

The property constructor has the below syntax, where bool is a boolean value.

bool.constructor

Parameters

The property constructor doesn't accept any parameters.

Result

The method constructor the function that created the Boolean prototype.

Example 1: Using the Property

The below example shows the basic usage of the property.

var bool = false;

// Returns the function that created the Boolean prototype
document.write(bool.constructor);

Output:

function Boolean() { [native code] }

Browser Support

This property is introduced in ES1 (ECMAScript 1).

It is supported in all modern browsers, like Google Chrome, Internet Explorer or Edge, Firefox, Apple Safari, Opera, etc.,

Related Links