//差集
var difference = array1.concat(array2).filter(value => (array1.includes(value) && !array2.includes(value)) || (array2.includes(value) && !array1.includes(value)));
//交集
function intersection(array1, array2) {
array1 = [...new Set([...array1])];
array2 = [...new Set([...array2])];
return array1.filter(value => array2.includes(value));
}
//并集
var union = [...new Set([...array1, ...array2])];