/*
* 判断数组的方法
* */
/*1、instanceof 运算符
* 这个运算符可以判断一个对象是否是在其原型链上原型构造函数中的属性
* */
let arr = [];
console.log(arr instanceof Array); //true
/*
* 2、constructor
* 这个属性是返回对象相对应的构造函数。
* */
let arr = [];
console.log(arr.constructor === Array)
/*
* 3、对象原型方法
* */
Object.prototype.toString.call();
let arr = [];
Object.prototype.toString.call(arr); // "[object Array]"
/*
* 4、数组自带的isArray方法
* */
let arr = [];
console.log(Array.isArray(arr)); //true
/*
* 5、原型方法 __proto__
* */
arr.__proto__ === Array.prototype // true
Array.prototype.isPrototypeOf(arr) // true