I'm stuck with sorting this array:
[
["name1", { count: 20 }],
["name2", { count: 10 }]
]
Is there a way to sort this array based on the count values?
My attempt using the sort function was unsuccessful,
const sort = Array.sort((a, b) => b.count - a.count);
Unfortunately, this didn't have any effect.