数组去重
57
function distinct(a, b) {
return Array.from(new Set([...a, ...b]))
}
16
function distinct(a, b) {
let arr = a.concat(b)
let result = []
let obj = {}
for (let i of arr) {
if (!obj[i]) {
result.push(i)
obj[i] = 1
}
}
return result
}

浙公网安备 33010602011771号