摘要: let arr1 = [0,1,2,3,4,5]; let arr2 = [0,4,6,1,3,9]; let arr =Array.from(new Set(arr1.concat(arr2))); console.log('arr',arr); // arr (8) [0, 1, 2, 3, 4 阅读全文
posted @ 2021-06-04 16:10 前端那点事 阅读(5518) 评论(0) 推荐(0) 编辑
摘要: let arr1 = [0,1,2,3,4,5]; let arr2 = [0,4,6,1,3,9]; const _arr1 =arr1.filter(item1 => !arr2.includes(item1)); const _arr2 =arr2.filter(item2 => !arr1. 阅读全文
posted @ 2021-06-04 15:09 前端那点事 阅读(4625) 评论(2) 推荐(0) 编辑