判断是对象还是数组对象

// 原型
console.log(Array.prototype.isPrototypeOf(file))
// 构造函数
console.log(file instanceof Array)
console.log(Object.prototype.toString.call(file)) // [object Object] [object Array]
// ES6
console.log(Array.isArray(file))

  

posted @ 2020-03-26 16:46  微木Vmumu  阅读(109)  评论(0编辑  收藏  举报