Array.isArray
代码均来自:MDN
//利用Object.prototype.toString实现类型判断
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}
- Array.prototype 也是一个数组
Array.isArray(Array.prototype