let arr=[1,2,3];
let obj={"name":"abc"};
console.log(arr instanceof Array);
console.log(obj instanceof Object);
判断数据类型是数组还是对象
最新推荐文章于 2022-12-16 17:06:53 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
let arr=[1,2,3];
let obj={"name":"abc"};
console.log(arr instanceof Array);
console.log(obj instanceof Object);