//数组去重 function distinct(arr) { let result = []; let obj = {}; for(let i of arr) { if(!obj[i]) { result.push(i); obj[i] = 1; } } return result }
转载于:https://www.cnblogs.com/fei-le/p/11383281.html