• Skip to main content
  • Skip to search
  • Skip to select language
HTML

Structure of content on the web

  • Web APIs

    Interfaces for building web applications

  • Learn
    • CSS

      Learn to style content using CSS

    • Overview

      A customized MDN experience

    • FAQ

      Frequently asked questions about MDN Plus

  • HTTP Observatory

    Scan a website for free

  • JavaScript
  • Array.isArray()
      • Deutsch
      • Español
      • Français
      • 日本語
      • 한국어
      • Português (do Brasil)
      • Русский
      • 中文 (简体)
      • 正體中文 (繁體)

    In this article

    • Try it
    • Syntax
    • Description
    • Examples
    • Specifications
    • Browser compatibility
    • See also
    1. Array.from()
    2. Array[Symbol.species]
  • Instance methods
    1. Array.prototype.entries()
    2. Array.prototype.find()
    3. Array.prototype.flat()
    4. Array.prototype.indexOf()
    5. Array.prototype.map()
    6. Array.prototype.reduceRight()
    7. Array.prototype.some()
    8. Array.prototype.toReversed()
    9. Array.prototype.unshift()
    10. Array: length
    11. Function.prototype.bind()
    12. Function: displayName Non-standard
    13. Function.prototype.arguments Non-standard Deprecated
    14. Function.prototype.caller Non-standard Deprecated
  • Instance methods
    1. Object.prototype.__defineGetter__() Deprecated
    2. Object.prototype.__defineSetter__() Deprecated
    3. Object.prototype.__lookupGetter__() Deprecated
    4. Object.prototype.__lookupSetter__() Deprecated
    5. Object.prototype.toLocaleString()
    6. Object.prototype.__proto__ Deprecated
    7. Array.

  • Try it

    console.log(Array.isArray([1, 3, 5]));
    / Expected output: true
    
    console.log(Array.isArray("[]"));
    / Expected output: false
    
    console.log(Array.isArray(new Array(5)));
    / Expected output: true
    
    console.log(Array.isArray(new Int16Array([15, 33])));
    / Expected output: false
    

    Syntax

    js
    Array.isArray(value)
    

    Parameters

    value

    The value to be checked.

    Return value

    true if value is an in operator, for a private property initialized by the Array() constructor.

    It is a more robust alternative to instanceof Array because it avoids false positives and false negatives:

    • Array.isArray() rejects values that aren't actual Array instances, even if they have Array.prototype in their prototype chain — instanceof Array would accept these as it does check the prototype chain.
    • Array.isArray() accepts Array objects constructed in another realm — instanceof Array returns false for these because the identity of the Array constructor is different across realms.

    See the article "Determining with absolute accuracy whether or not a JavaScript object is an array" for more details.

    Examples

    Using Array.isArray()

    js
    / all following calls return true
    Array.isArray([]);
    Array.isArray([1]);
    Array.isArray(new Array());
    Array.isArray(new Array("a", "b", "c", "d"));
    Array.isArray(new Array(3));
    / Little known fact: Array.prototype itself is an array:
    Array.isArray(Array.prototype);
    
    / all following calls return false
    Array.isArray();
    Array.isArray({});
    Array.isArray(null);
    Array.isArray(undefined);
    Array.isArray(17);
    Array.isArray("Array");
    Array.isArray(true);
    Array.isArray(false);
    Array.isArray(new Uint8Array(32));
    / This is not an array, because it was not created using the
    / array literal syntax or the Array constructor
    Array.isArray({ __proto__: Array.prototype });
    

    instanceof vs. Array.isArray()

    When checking for Array instance, Array.isArray() is preferred over instanceof because it works across realms.

    js
    const iframe = document.createElement("iframe");
    document.body.appendChild(iframe);
    const xArray = window.frames[window.frames.length - 1].Array;
    const arr = new xArray(1, 2, 3); / [1, 2, 3]
    
    / Correctly checking for Array
    Array.isArray(arr); / true
    / The prototype of arr is xArray.prototype, which is a
    / different object from Array.prototype
    arr instanceof Array; / false
    

    Specifications

    Specification
    ECMAScript® 2026 Language Specification
    # sec-array.isarray

    Browser compatibility

    See also

    • Polyfill of Array.isArray in core-js
    • es-shims polyfill of Array.isArray
    • Indexed collections guide
    • Array

    Help improve MDN

    Array.isArray() static method checks whether a value is an array.","name":"Array.isArray()"}},"browserCompat":["javascript.builtins.Array.isArray"],"pageType":"javascript-static-method"}}

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant