以记录备忘为目的,顺便分享,后续不定期补充
if(typeof arr === ‘object’){
Object.prototype.toString.call(arr) === ‘[object Array]’
}
arr instanceof Array
arr.constructor === Array
js-判断对象是不是数组
最新推荐文章于 2023-07-24 16:33:47 发布
以记录备忘为目的,顺便分享,后续不定期补充
if(typeof arr === ‘object’){
Object.prototype.toString.call(arr) === ‘[object Array]’
}
arr instanceof Array
arr.constructor === Array