Check If Something Is An Array
> Array.isArray('Hello, World!');
// => false
> Array.isArray(['One', 2, [3]]);
// => true
> Array.isArray({ foo: 'bar' });
// => false
> Array.isArray([]);
// => trueif (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}Last updated