So I have this array that contains objects:
var terms = [
{
'class-1': {name: 'English', completed: '12/02/19', letterGrade: 'A'},
'class-2': {name: 'Math', completed: '12/02/19', letterGrade: 'A'},
'class-3': {name: 'P.E.', completed: '12/02/19', letterGrade: 'A'},
'class-4': {name: 'World History', completed: '12/02/19', letterGrade: 'A'}
},
{
'class-1': {name: 'P.E.', completed: '12/02/19', letterGrade: 'A'},
'class-2': {name: 'World History', completed: '12/02/19', letterGrade: 'A'},
},
{
'class-1': {name: 'P.E.', completed: '12/02/19', letterGrade: 'A'},
'class-2': {name: 'English', completed: '12/02/19', letterGrade: 'A'},
'class-3': {name: 'Math', completed: '12/02/19', letterGrade: 'A'},
},
{
'class-1': {name: 'English', completed: '12/02/19', letterGrade: 'A'},
'class-2': {name: 'Algebra', completed: '12/02/19', letterGrade: 'A'},
'class-3': {name: 'Psychology', completed: '12/02/19', letterGrade: 'A'},
}
]
And I want to sort each of the nested objects alphabetically on the name of the class. But I want the whole array to be sorted.
Not sure how I should go about doing this. What's holding me up is the amount of nests in the data.