JavaScript Array.isArray() Method
The Array.isArray() static method checks whether a value is an array, returning true or false.
Description
The Array.isArray() static method determines whether the value passed to it is an array. It is the reliable way to check, because arrays are objects and typeof [] returns "object".
It also works for arrays created in other windows or iframes, where value instanceof Array would return false because each window has its own Array constructor. Array-like objects, such as a NodeList, arguments or typed arrays, are not arrays and return false.
Use it before calling array methods on values that might be something else, such as function arguments or parsed JSON. It's the standard check used by libraries and in type-checking code. Note that it returns true for Array.prototype itself, which is an array, but that rarely matters in practice.
Syntax
Array.isArray(value)Parameters
- valueThe value to check.
Return Value
true if the value is an array, otherwise false.
Example
Browser Support
The following information will show you the current browser support for the Array.isArray() method. Hover over a browser icon to see the version that first introduced support for this method.
Desktop





Tablets & Mobile





