As far as I know there are three ways of finding out if an object is an Array
by isArray
function if implemented
Array.isArray()
instanceof
tests whether the given constructor (Array) is in the object's prototype chain, while your second approach only checks the actual type of the object. In other words, if your object inherits from Array, the second test will be true, but the first will be false. Now, it's not typically done to inherit from Array (it doesn't work right in IE), but walking the prototype chain presumably adds some overhead (especially if the object isn't an array).