lets say I have the following:
let a = [
{"a": 25},
{"a": 11},
{"a": 34}
];
how can I sort this so that the result would be:
let a = [
{"a": 34},
{"a": 25},
{"a": 11}
];
basically highest to lowest
Thank you 🙂
>Solution :
a.sort((a, b) => b.a - a.a)