常规使用 Array.isArray() 用于判断一个对象是否为数组。如果对象是数组返回 true,否则返回 false。
Array.isArray([]) // true
利用 constructor 属性返回对 创建 此对象 的 函数 的引用。
[].constructor === Array //true
instanceof 运算符用于检测构造函数的 prototype 属性是否出现在某个实例对象的原型链上
[] instanceof Array //true
使用 Object 上原型 toString 方法(返回对象的具体类型)
Object.prototype.toString.call([]).slice(8,-1) === 'Array'//true
原型链
({}).toString.call([]).slice(8,-1) === 'Array' // true