let a=[1,2,3,4,1,2,3,4,1,4];
let b= new Set(a);
console.log(b)
还有add方法介绍下:
let a=new Set();
let b=[1,1,2,2,3,3,4,4]
b.map((val)=>{
a.add(val)
})
2023-08-21 17:21:04
let a=[1,2,3,4,1,2,3,4,1,4];
let b= new Set(a);
console.log(b)
还有add方法介绍下:
let a=new Set();
let b=[1,1,2,2,3,3,4,4]
b.map((val)=>{
a.add(val)
})