Imagine I possess the subsequent item:
{
"bands": [{
"name": "The Wibbles",
"formed": 1992,
"albums": [{
"name": "A New Wibble",
"songs": [{
"name": "Song One",
"time": "3:12"
}, {
"name": "Song Two",
"time": "2:34"
}, {
"name": "Song Three",
"time": "2:21"
}, {
"name": "Song Four",
"time": "3:44"
}, {
"name": "Song Five",
"time": "3:54"
}]
}, {
"name": "The Wibbles Strike Back",
"songs": [{
"name": "Song Six",
"time": "8:12"
}, {
"name": "Song Seven",
"time": "7:34"
}, {
"name": "I Killed a Girl",
"time": "8:21"
}, {
"name": "Monkey Fighters",
"time": "7:44"
}, {
"name": "Funkallica",
"time": "9:54"
}]
}]
}]
}
If I were to utilize AngularJS (and possibly underscore.js), how could albums be organized by the shortest track, overall album length, or by the quickest average duration of the tracks in each album?
Subsequently, if a new band was to be introduced, how would the bands themselves be sorted based on these criteria (shortest track / album duration / average track duration)?