JS数组相减

const arr1 = [1, 2, 3]
const arr2 = [1, 3]
const arr3 = arr1.filter(v => !arr2.includes(v))   // [2]
posted @ 2022-04-08 18:19  MegaSu  阅读(149)  评论(0编辑  收藏  举报