I have an array. How can I find dublicates by type, name and size and increment amount. And after increasing amount delete the same ones.
[
{
"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
}
]