var set1 = new Set([1,2,3]);
var set2 = new Set([2,3,4]);
並集
let union = new Set([...set1, ...set2]);
交集
let intersect = new Set([...set1].filter( x => set2.has(x)));
差集
let difference = new Set([...set1].filter(x => !set2.has(x)));
出處:http://blog.csdn.net/haijing1995/article/details/72842810