can.isArray

  • function
 

Check if an object is an array.

can.isArray(obj)

Parameters

  1. obj {*}

    The object to check.

Returns

{Boolean}

Whether obj is an Array.

can.isArray(object) returns if the object is an explicitly an Array. If can.isArray is passed an array-like object, it will return false.

can.isArray([]);    // true
can.isArray([1, 2, 3]);    // true
can.isArray(can.makeArray({0: "foo", 1: "bar"})); // true
(function() { return can.isArray(arguments); })(); // false
can.isArray(document.querySelectorAll("p")); // false
can.isArray(true); // false