JavaScript Array isArray()
Example
Check whether an object is an array:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
Array.isArray(fruits) // Returns true
Try it Yourself »
Definition and Usage
The isArray() method returns true if an object is an arry,
otherwise false.
Browser Support
isArray() is fully supported in all modern browsers:
| Chrome 5 | IE 9 | Edge 12 | Firefox 4 | Safari 5 | Opera 10.5 |
| Feb 2010 | Sep 2010 | Jul 2015 | Jul 2010 | Jun 2010 | Mar 2010 |
Syntax
Array.isArray(obj)
Parameter Values
| Parameter | Description |
|---|---|
| obj | Required. The object to be tested |
Technical Details
| Return Value: | A Boolean. Returns true if the object is an array, otherwise it returns false |
|---|---|
| JavaScript Version: | ECMAScript 5 |

