Array static methods
Array.isArray()
Tests whether the supplied value is an Array according to the language’s array check. It works across realms and does not mistake ordinary array-like objects for arrays. A revoked Proxy can throw.
Formal Syntax & Structure
javascript syntaxjavascript
Array.isArray(value)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| value | any | Value to inspect. |
Return Value
boolean
True for arrays and applicable proxies to arrays.
Working Example
Example Snippetjavascript
console.log(Array.isArray([]),Array.isArray({length:0}));