I'm working with an array of objects that looks something like this:
const fruits = [
{
Fruit: Apple,
Count: 4
},
{
Fruit: Orange,
Count: 3
},
{
Fruit: Apple,
Count: 2
}
]
I like to end up with my array looking something like this:
const fruits = [
{
Fruit: Apple,
Count: 6
},
{
Fruit: Orange,
Count: 3
},
]
Is there any help with this? I've tried to use Reduce but Reduce, needless to say, is my biggest weakness in JavaScript. I've looked at so many articles that get a close answer but nothing that can fully help me. Thank you for the help.