Hacker News new | ask | show | jobs
by paulddraper 887 days ago
> since sorting is already in the standard library

Right. For example, to sort a list of numbers:

  [5, 14, 1, 2].sort()
Works great! No, wait, that's obviously wrong. Uh,

  [5, 14, 1, 2].sort((a, b) => a - b)