Hi guys i've question about how to group by key id value and do sum on ( key harga value and key qty value) below are the array of objects:
order: [
{
id: 4,
idkatg: 2,
kategori: 'minuman',
nmprod: 'es mambo',
harga: 8000,
qty: 1
},
{
id: 4,
idkatg: 2,
kategori: 'minuman',
nmprod: 'es mambo',
harga: 8000,
qty: 1
}
]
what i wan't to achieve is like this :
order:[
{
id: 4,
idkatg: 2,
kategori: 'minuman',
nmprod: 'es mambo',
harga: 14000,
qty: 2
}
]
is there any solution using lodash maybe ?