English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

JavaScript Array constructor attribute

 JavaScript Array Object

Constructor attributeReturns a reference to the function for creating an example prototype.

For JavaScript Array, the constructor property returnsFunction Array() { [native code] }.

For JavaScript Boolean, the constructor property returnsFunction Boolean() { [native code] }.

For JavaScript Numbers, the constructor property returnsFunction Number() { [native code] }.

For JavaScript String, the constructor property returnsFunction String() { [native code] }.

Syntax:

array.constructor
var fruits = ['Apple', 'Mango', 'Banana'];
fruits.constructor;
Test and see‹/›

Browser Compatibility

All browsers fully support the Constructor property:

Properties
constructorYesYesYesYesYes

Technical Details

Return Value:Returns the function that created the object, that isFunction Array() { [native code] }
JavaScript Version:ECMAScript 1

 JavaScript Array Object