复杂数组去重:
a = [[1,1,6],[1,2,5],[1,7],[1,2,5],[1,7],[2,6]]
b = a.reduce((acc, cur) => {
if(!acc.some((item) => JSON.stringify(item) === JSON.stringify(cur))) {
acc.push(cur)
}
return acc
}, [])
复杂数组去重:
a = [[1,1,6],[1,2,5],[1,7],[1,2,5],[1,7],[2,6]]
b = a.reduce((acc, cur) => {
if(!acc.some((item) => JSON.stringify(item) === JSON.stringify(cur))) {
acc.push(cur)
}
return acc
}, [])