I want to filter my array and remove duplicated values. I can explain better what I want to do with an example. That’s my array:
products = [
{
itemno:1,
number:3,
weight:5,
height:3
},
{
itemno:2,
number:3,
weight:2,
height:1
},
{
itemno:3,
number:4,
weight:8,
height:8
},
]
I want to get just item with higher itemno, if have with same number. Like:
output:
{
itemno:2,
number:3,
weight:2,
height:1
},
{
itemno:3,
number:4,
weight:8,
height:8
},
I’m really confused and tired about this. I’m waiting your help, thanks a lot!