Array.isArray()
The Array.isArray() static method determines whether the passed 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.
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.