参考答案:
console.log(Array.isArray([]))//true
console.log(Array.isArray({}))//false
console.log([] instanceof Array)//true
console.log({} instanceof Array)//false
console.log([].constructor)//[Function: Array]
console.log({}.constructor)//[Function: Object]
console.log(Object.prototype.toString.call([]))//[object Array]
console.log(Object.prototype.toString.call({}))//[object Object]
最近更新时间:2024-07-20