In JavaScript, the constructor property returns the constructor function for an object.
In JavaScript, the constructor property returns the constructor function for an object.
The return value is a reference to the function, not the name of the function:
For JavaScript arrays the constructor property returns function Array() { [native code] }
You can use the constructor property to define if a variable is an array.
array.constructor
function Array() { [native code] }
The constructor property returns an array's constructor function:
var myArray = ["B", "O", "A", "M"]; console.log( myArray.constructor);