Check if value is array in JavaScript
instanceof Array
;[] instanceof Array // true
'test' instanceof Array // false
Array.isArray
As of ES5 there is now also:
Array.isArray([]) // true
Array.isArray('test') // false
Array.isArray({}) // false
.constructor === Array
;[].constructor === Array // true
'foo'.constructor === Array // false
From Stack Overflow