SOURCE

// 数组取并集
function arrUnion(arr1, arr2) {
  const arr = Array.from(new Set(arr1.concat(arr2)));
  return arr;
}
// 数组取交集
function arrIntersection(arr1, arr2) {
  const bSet = new Set(arr2);
  const arr = Array.from(new Set(arr1.filter((item) => bSet.has(item))));
  return arr;
}
//数组去重
function uniqueArray(arr=[]){
    const arrSet = new Set(arr)
    return Array.from(arrSet)
}
console 命令行工具 X clear

                    
>
console