Array.isArray()
The Array.isArray() static method checks whether a value is an array.
Overview
The Array.isArray() static method checks whether a value is an array.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 4 | 12 | 4 | 5 | 18 | 5 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
JAVASCRIPT
Array.isArray([1, 2, 3]); // true
Array.isArray('string'); // false
Array.isArray({ length: 3 }); // false
Array.isArray(new Array()); // true Live demo
practical typecheck
value that array. case. onlyprocessing row, safeall co-d. writeside..
PreviewFullscreen
Use cases
Using Array.isArray()
The Array.isArray() static method checks whether a value is an array.
Cautions
- No specific concerns. Stable across all major browsers.
Accessibility
- When updating the DOM dynamically, announce important changes to assistive technology with aria-live regions.
Related links
Powered by web-features