JavaScript object constructor property

Definition and usage

constructor The property returns the function that creates the prototype of the object.

For JavaScript objects, the constructor property returns:

function Object() { [native code] }

Instance

Get the object constructor:

const person = {
  firstName: "Bill",
  lastName: "Gates",
  age: 19,
  eyeColor: "blue"
};
let text = person.constructor;

Try it yourself

Syntax

object.constructor

Return value

function Object() { [native code] }

Browser support

constructor It is an ECMAScript1 (ES1) feature.

All modern browsers support ES1 (JavaScript 1997):

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support

Related Pages

JavaScript Object

JavaScript Object Definition

JavaScript Object Method

JavaScript Object Property