Open dashengzi66 opened 3 years ago
const array = [5,4,7,8,9,2,7,5];
方法1 array.filter((item,idx,arr) => arr.indexOf(item) === idx);
方法2 const nonUnique = [...new Set(array)];
数组去重
const array = [5,4,7,8,9,2,7,5];
方法1 array.filter((item,idx,arr) => arr.indexOf(item) === idx);
方法2 const nonUnique = [...new Set(array)];