Closed mathiasbynens closed 10 years ago
The compare(a, b) function passed to Array#sort expects 0 if both elements are equal, less than 0 if a should come first, and greater than 0 if b should come first.
compare(a, b)
Array#sort
0
a
b
Previously, values less than 0 were never returned, causing the sorting to be wonky.
deploy plz
Will do later today. I need to fix the build system so I can do this automatically. Right now it involves some nasty manual steps. :/
Deployed! (I hope I've done this right ...)
The
compare(a, b)
function passed toArray#sort
expects0
if both elements are equal, less than0
ifa
should come first, and greater than0
ifb
should come first.Previously, values less than
0
were never returned, causing the sorting to be wonky.