A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.w3schools.com/jsref/jsref_isarray.asp below:

Website Navigation


JavaScript Array isArray() Method

JavaScript Array.isArray() Examples

Check if an object is an array:

const fruits = ["Banana", "Orange", "Apple", "Mango"];
let result = Array.isArray(fruits);

Try it Yourself »

Check if another datatype is an array:

let text = "W3Schools";
let result = Array.isArray(text);

Try it Yourself » Description

The isArray() method returns true if an object is an array, otherwise false.

Array.isArray()

Array.isArray() is a static property of the JavaScript Array object.

You can only use it as Array.isArray().

Using x.isArray(), where x is an array will return undefined.

Syntax Parameters Parameter Description obj Required.
An object (or any data type) to be tested. Return Value Type Description A boolean true if the object is an array, otherwise false. Browser Support

isArray() is an ECMAScript5 (ES5 2009) feature.

JavaScript 2009 is supported in all browsers since July 2013:

Chrome
23 IE/Edge
11 Firefox
21 Safari
6 Opera
15 Sep 2012 Sep 2012 Apr 2013 Jul 2012 Jul 2013

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4