Is there a way to identify duplicates in an array based on type, name, and size, increment the amount, and then remove the duplicate entries?
[
{
"name": "Pizza with pepper",
"imageUrl": "...",
"type": 0,
"size": 26,
"price": "803",
"amount": 1
},
{
"name": "Pizza with pepper",
"imageUrl": "...",
"type": 1,
"size": 40,
"price": "803",
"amount": 1
},
{
"name": "Peperoni",
"imageUrl": "...",
"type": 0,
"size": 30,
"price": "803",
"amount": 1
},
{
"name": "Peperoni",
"imageUrl": "...",
"type": 0,
"size": 30,
"price": "803",
"amount": 1
}
]