i have two arrays of objects i need to find the matching id from the first array in the seconde one, right now the code works but i need the elements in the first array CartVar to only be used once so there is no repetition
cart.map((order_item, index) => {
return (
<li key={index}>
<div>
<a>
{order_item.title}
</a>
<span>
{CartVar.find((x) => x.id === order_item._id).Quantity} x {order_item.Price}$
</span>
</div>
</li>
);
})