Hacker News new | ask | show | jobs
by VikingCoder 4949 days ago
The sort is not stable. When I sort by W, I end up with Colts and then Rams. When I sort by L, at the bottom, I end up with Rams and then Colts.

When I sort by T, since they're all 0, I'd expect nothing to change, but the whole list inverts...

In general, it's very nice. I agree with TazeTSchnitzel's comment that it'd be awesome to have it pull data from a table, so that there's a fallback.

1 comments

Thanks for checking it out. The sort used in the code is Javascript's native sort method which is not guaranteed to be stable and varies by browser (Chrome vs Firefox for example sort differently in the W/L/T columns - try clicking W then T in each browser.) Kind of annoying really.

For sure, the invert part is not great though.

Edit: Found more info: http://stackoverflow.com/questions/3026281/array-sort-sortin...