I need help sorting an object displayed below. My goal is to calculate the sum of all rating
properties for each object, and then sort the objects based on the highest total rating.
For instance, if the total rating for Intro 1
is 7 and for Intro 2
is 3, then Intro 1
should be listed first.
{
'Intro 2': [
{
deckName: 'Test 2',
rating: 1
},
{
deckName: 'Test 2',
rating: 2
}
],
'Intro 1': [
{
deckName: 'Test 1',
rating: 3
},
{
deckName: 'Test 1',
rating: 4
}
]
}