This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.



Determines whether an object is an array.


Array.isArray( object )
Required. The object to test.

Return Value

Boolean value. Either true if object is an array; otherwise, false.

If the object argument is not an object, false or undefined is returned.


The following example illustrates the use of the Array.isArray function.

// Using Array string litteral
var ar = [];
 var result = Array.isArray(ar);
 // Output: true

// Using new Array with an empty set
 var ar = new Array();
 var result = Array.isArray(ar);
 // Output: true

 var ar = [1, 2, 3];
 var result = Array.isArray(ar);
 // Output: true

// Testing with a string litteral "an array"
 var injectingString = Array.isArray("an array");
 // Output: false

// Testing with an object litteral
 var injectingObject = Array.isArray({});
 // Output: false

See also

Other articles

Specification Array.isArray ( arg ) ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011


  • Microsoft Developer Network: Article