Filter an array using another array

Planted on

Sometimes you want to do something with an array based on another array. This small snippet has you covered!

const result = masterData.filter((ad) =>
  filterData.every((fd) => fd.userid !== md.userid)
);

result contain all MasterData except for things in the FilterData