en.javascript.info/1-js/4-data-structures/7-array-methods/5-sort-back/solution.md
Ilya Kantor 87bf53d076 update
2014-11-16 01:40:20 +03:00

144 B

//+ run
var arr = [ 5, 2, 1, -10, 8];

function compareReversed(a, b) {
  return b - a;
}

arr.sort(compareReversed);

alert(arr);