参考代码 参考代码let arr1 = [1, 2, 3, 5, 6];let arr2 = [1, 3, 5];// 差集var temp = arr1.concat(arr2).filter(item => !arr2.includes(item))console.log(temp);