Hello I have an array of this form which I am displaying on my meteor template.
var data = [{text_name:'My life',
score: [{name : 'james',score: 10},
{name : 'john',score : 40},
{name : 'Abu',score : 80}]},
{text_name:'The game real',
score: [{name : 'penny',score: 30}
{name : 'john',score : 20} ,
{name : 'Abu',score : 30}] }]
I want to sort the score
key which is an array of objects in descending order. Using the example data in the text_name:'My life'
I want Abu scores to display first because he scored highest.
I have tried sorting by using the code found on this link Sorting an array of JavaScript objects.