xxxxxxxxxx
let numbers = [0, 1, 2, 3, 10, 20, 30];
numbers.sort((a, b) => a - b);
console.log(numbers);
xxxxxxxxxx
objs.sort((a,b) => a.last_nom - b.last_nom); // b - a for reverse sort
xxxxxxxxxx
const numbers = [4, 2, 5, 1, 3];
numbers.sort(function(a, b) {
return a - b;
});
console.log(numbers);
// [1, 2, 3, 4, 5]