js找出数组的差异
function ArryDiff(a,b){
return [...a.filter(x => !b.includes(x)),...b.filter(x => !a.includes(x))]
}
const a = [1,2,3,4]
const b = [1,2,3,4,5,6,7,1]
ArryDiff(a,b) //[5, 6, 7]
function ArryDiff(a,b){
return [...a.filter(x => !b.includes(x)),...b.filter(x => !a.includes(x))]
}
const a = [1,2,3,4]
const b = [1,2,3,4,5,6,7,1]
ArryDiff(a,b) //[5, 6, 7]