I already tried:
let age = arr.sort(function(a, b) {
return b -a;
});
it was good for simple array, but it does not work. In this array:
let list = [
[
['firstName', 'Joe'],
['age', 42],
['gender', 'male'],
],
[
['firstName', 'Mary'],
['lastName', 'Jenkins'],
['age', 36],
['gender', 'female'],
],
[
['lastName', 'Kim'],
['age', 40],
['gender', 'female'],
],
];
it's double array, and 'age' index locate is different. How can I approach the 'age' and align? I want to sort ascending.