The constructor property returns the constructor function for the array.
Example
constructor Syntax
The syntax to access the constructor property is:
arr.constructor
Here, arr is an array.
constructor Parameters
The constructor is a property in JavaScript, so it doesn't take any parameters.
constructor Return Value
- Returns the constructor function for the array.
For JavaScript arrays, the constructor property returns function Array() { [native code] }.
Note: The return value is a reference to the function, not the name of the function.
Example : Using constructor property
Output
[Function: Array]
Recommended Reading: JavaScript Constructor Function