Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 145 Bytes

File metadata and controls

15 lines (9 loc) · 145 Bytes
//+ run
var arr = [5, 2, 1, -10, 8];

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

arr.sort(compareReversed);

alert( arr );