Widely availableSupported across all major browsers. Safe to use in production.

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

Array or or. check

various de-ta type to Array.isArray Runresult inspect it..

PreviewFullscreen

Array styleobject and. comparison

Length property hasobject and. Array block by..

PreviewFullscreen

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.

Powered by web-features