判断一个变量是否为数组

instanceof 运算符用于检测构造函数的 prototype 属性是否出现在某个实例对象的原型链上。

let a = [1,2,3]
a.instanceof Array // true

a.__proto__ === Array.prototype

results matching ""

    No results matching ""