Hacker News new | ask | show | jobs
by ruxkor 5117 days ago
javascript sorting: having expected a sorting somewhat similar to python and being very... surprised that javascript essentially sorts everything but primitive types by comparing their String counterparts, I decided to implement a more sensible compare function, similar to e.g. python:

https://gist.github.com/2772234

I am currently using this in server only environments, so there is no comparison for DOM elements.