📜  javascript代码示例中的交集和差异

📅  最后修改于: 2022-03-11 15:01:47.990000             🧑  作者: Mango

代码示例1
const intersection = new Set(Array.from(set1).filter(x => set2.has(x)));
const difference = new Set(Array.from(set1).filter(x => !set2.has(x)));