Easy Tutorial
❮ Event Ondragenter Prop Meta Scheme ❯

JavaScript isArray() Method

JavaScript Array Object

Example

Determine if an object is an array:

function myFunction() {
    var fruits = ["Banana", "Orange", "Apple", "Mango"];
    var x = document.getElementById("demo");
    x.innerHTML = Array.isArray(fruits);
}

Definition and Usage

The isArray() method is used to determine whether an object is an array.

It returns true if the object is an array, otherwise it returns false.


Browser Support

The numbers in the table specify the first browser version that fully supports the method.

Method
isArray() 5 9.0 4 5 10.5

Syntax

Array.isArray(obj)

Parameters

| Parameter | Description | | obj | Required. The object to be checked. |

Technical Details

Return Value: Boolean. Returns true if the object is an array, otherwise returns false.
JavaScript Version: ECMAScript 5
--- ---

JavaScript Array Object

❮ Event Ondragenter Prop Meta Scheme ❯