I have an array of objects that represent hockey rank data:
[
{
name: "Russia",
points: 10,
iihf: 1
},
{
name: "USA",
points: 10,
iihf: 7
},
{
name: "Slovakia",
points: 8,
iihf: 6
}
]
I want to sort the data descending from the highest score. If two or more teams share the same point count, they have to be fine sorted using next dimensions, namely the IIHF rank (ascending order). Is there an elegant solution to this?
Thanks.