NOVEMBER 13, 2018
let numbers = [-34, 100, 20, 2, 3, 5, 6]; numbers.sort( (a, b) => a - b ); // Ascending sort // [ -34, 2, 3, 5, 6, 20, 100 ] numbers.sort( (a, b) => b - a ); // Descending sort // [ 100, 20, 6, 5, 3, 2, -34 ]
https://basarat.gitbooks.io/algorithms/content/docs/sorting/intro.html ↩