JavaScript Array constructor property
- Previous Page concat()
- Next Page copyWithin()
- Go to the Previous Level JavaScript Array Reference Manual
Definition and usage
In JavaScript,constructor
The property returns the constructor function of the object.
Its return value is a reference to the function, not the function name:
For JavaScript arrays, the constructor property returns:
function Array() { [native code] }
For JavaScript objects, the constructor property returns:
function Object() { [native code] }
Instance
The constructor property returns the constructor function of the array:
var fruits = ["Banana", "Orange", "Apple", "Mango"]; fruits.constructor; // Returns function Array() { [native code] }
Syntax
array.constructor
Technical details
Return value: | function Array() { [native code] } |
---|---|
JavaScript version: | ECMAScript 1 |
Browser support
All browsers fully support constructor
Property:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
Related Pages
Tutorial:JavaScript Array
Tutorial:JavaScript Array Const
Tutorial:JavaScript Array Methods
Tutorial:JavaScript Array Sorting
Tutorial:JavaScript Array Iteration
- Previous Page concat()
- Next Page copyWithin()
- Go to the Previous Level JavaScript Array Reference Manual