let arr = [1,2,3,3,3];
let only = Array.from(new Set(arr));
console.log(only); //[1,2,3]
ES6去重
最新推荐文章于 2023-08-18 14:00:00 发布
let arr = [1,2,3,3,3];
let only = Array.from(new Set(arr));
console.log(only); //[1,2,3]