I currently have an object of objects, and I am looking to sort three of the objects of objects on one of the objects of objects values.
For example, if i have
{ A : { 1: 5, 2: 10, 3: 7},
B : { 1: Alpha, 2: Beta, 3: Charlie},
C : { 1: Z, 2: Y, 3: X}
}
I want to sort the object in A
by the value (in desc order), while keeping the integrity of the key.
And this same sort is done for B
and C
(orderwise).
The resulting arrays would be [10, 7, 5]
, [Beta, Charlie, Alpha]
, and [Y, X, Z]
.