let arr1 = [1,2,3,4,5,6,7,8,9,0]; let arr2 = [1,1,3,4,6]; //数组去重 let arr3 = [...new Set(arr2)]; console.log(arr3); //求 交集 let result = [...new Set(arr1)].filter(item =>{ let res2 = new Set(arr2); if(res2.has(item)){ return true; }else{ return false; } }); console.log(result); //并集 let result2 = [...new Set([...arr1,...arr2])]; console.log(result2);