Array.isArray()

ES5+

Determines whether the passed value is an Array.

Syntax

Array.isArray(value)

Parameters

value any

The value to be checked

Return Value

boolean

true if the value is an Array; otherwise, false

Examples

JavaScript
console.log(Array.isArray([1, 2, 3]));
console.log(Array.isArray('hello'));
console.log(Array.isArray({length: 3}));
Output:
// true false false

Related Methods