fork download
  1. import algorithm, future
  2.  
  3. const a = [1, 2, 3, 5, 12, 4, 7, 6, 7, 9]
  4. let sorted = a.sorted((a, b) => cmp(a, b))
  5. echo sorted
Success #stdin #stdout 0s 2392KB
stdin
Standard input is empty
stdout
@[1, 2, 3, 4, 5, 6, 7, 7, 9, 12]