Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

constructor Property (Array)

Specifies the function that creates an array.

array.constructor

The required array is the name of an array.

The constructor property is a member of the prototype of every object that has a prototype. This includes all intrinsic JavaScript objects except the Global and Math objects. The constructor property contains a reference to the function that constructs instances of that particular object.

The following example illustrates the use of the constructor property.

var x = new Array();

if (x.constructor == Array)
    document.write("Object is an Array.");
else
    document.write("Object is not an Array.");

// Output:
// Object is an Array.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.