Object.constructor

Specifies the function that creates an object's prototype. Note that the value of this property is a reference to the function itself, not a string containing the function's name.

Property of Object

Description

All objects inherit a constructor property from their prototype:

Examples

The following example creates a prototype, Tree, and an object of that type, theTree. The example then displays the constructor property for the object theTree.

This example produces the follow result:

theTree.constructor is function Tree(name) { this.name = name; }

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.