判断对象数组 采用 construvtor
instanceof 判断数组的时候都是Object
let arr=[]let obj={}console.log(arr instanceof Object) trueconsole.log(arr instanceof Array) trueconsole.log(arr.constructor === Object) falseconsole.log(obj.constructor === Object) true
判断对象数组 采用 construvtor
instanceof 判断数组的时候都是Object
let arr=[]let obj={}console.log(arr instanceof Object) trueconsole.log(arr instanceof Array) trueconsole.log(arr.constructor === Object) falseconsole.log(obj.constructor === Object) true