this is the json I'm working with
[
{
name: "Red Shoes",
quantity: 5,
},
{
name: "Red Shoes",
quantity: 3,
},
{
name: "Red Shoes",
quantity: 1,
},
{
name: "Yellow Shoes",
quantity: 11,
},
{
name: "Yellow Shoes",
quantity: 14,
}
]
What do I need to do to get this result in string format
Red Shoes - 9 PCS
Yellow Shoes - 25 PCS
etc
I know that it is necessary to use forEach here, but I can’t figure out how to get data in a similar format by matching names and quantities