JavaScript object constructor property
- Previous page assign()
- Next page create()
- Go up one 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 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 up one level JavaScript object reference manual