let a = {
'name':'张三'
}
let b = ['张三','李四']
console.log(Object.prototype.toString.call(a));//[object object]
console.log(Object.prototype.toString.call(b));//[Object Array]
js判断对象的数据类型
最新推荐文章于 2024-08-18 10:54:05 发布
let a = {
'name':'张三'
}
let b = ['张三','李四']
console.log(Object.prototype.toString.call(a));//[object object]
console.log(Object.prototype.toString.call(b));//[Object Array]