Skip to main content
Version: 1.3.0

isArray

Using

This function determines whether the given value is a real array.

  • Returns true if the value is an actual array created via [], new Array(), Array.from(), etc.
  • Returns false for non-array types and array-like objects (e.g., arguments, NodeList, or { length: 2 }).
Demo - use JSON
isArray(
)
true

Arguments

ArgumentTypeDescriptionExample
valueunknownCan be any type"text"
2
undefined

Returns

booleantrue if value is an array, false otherwise

Examples

isArray([]);
// true

isArray([1, 2, 3]);
// true

isArray(new Array());
// true

isArray('hello');
// false

isArray({ length: 2 });
// false

isArray(document.querySelectorAll('div'));
// false

isArray(Object.create(Array.prototype));
// false

isArray(() => [true]);
// false

Resources

📦 Since:1.3.0
📦 Last updated:1.3.0
📦 Available in:1.3.0