I have DB (use json-server) like this:
DB = {
products: [
{id: 0, name: 'aaa', price: 10},
{id: 1, name: 'bbb', price: 20},
{id: 2, name: 'ccc', price: 50},
{id: 3, name: 'ddd', price: 1}
]
};
And array of ids:
cartItemsIds: [0, 3];
How can I get array of objects from DB with ids from cartItemsIds ?