So I am basically trying to say "give me all added items that were not actually added to the cart" with my filter function below. If any of the addedItems product ids cannot be found in the cartItems ids then it should return those items. But instead unaddedCartItems is an empty array when I know there are addedItems ids that are not the same as any of the cartItems ids. Do anyone know how to achieve this?
const unaddedCartItems = addedItems.filter((addedItem) => {
cartItems.forEach((cartItem) => {
return cartItem.id !== addedItem.productId;
});
});