I have the following problem in my ReactJs application. Let's say I have two arrays like this:
var cart = [
{id: 1, name: "item1"},
{id: 2, name: "item2"},
];
var productsArr = [
{proId: 1, category: 'cat1'},
{proId: 5, category: 'cat7'},
];
Is it possible to compare these 2 arrays and find any objects in productsArr which cart's id quals productsArr's proId and remove that object from only productsArr?
(If so, as I explained in this example, productsArr[0] should be removed.)
Thanks in advance.