直接上代码
//交集
let intersect = a.filter(v => b.includes(v));
//差集
let minus = a.filter(v => !b.includes(v));
//补集
let complement = a.filter(v => !b.includes(v)).concat(b.filter(v => !a.includes(v)))
//并集
let unionSet = a.concat(b.filter(v => !a.includes(v)));