我正在尝试从整个另一个数组中过滤出部分匹配的数组。例如,数组概述如下:
Array1 =
categories: 292300,
categories: 300,
categories: 292500280
Array2 =
300,
498
使用过滤器,我希望返回:
NewArray =
categories: 292300,
categories: 300
实现这一点的最佳方法是什么?我试过下面的代码没有运气:
const NewArray = Array1.filter(Array1 => !(Array1.categories.includes(Array2)))