JavaScript object constructor property
- Previous Page assign()
- Next Page create()
- Go to the Previous Level JavaScript Object Reference Manual
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;
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
- Previous Page assign()
- Next Page create()
- Go to the Previous Level JavaScript Object Reference Manual