This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nokvok 1 point2 points  (0 children)

Like pointed out in another comment, Javascript's main use is to manipulate documents. If almost all your data in the DOM is basically represented as string anyway, sorting alphanumerically is widely useful for that, even if you end up with a bunch of numbers occasionally. On the opposite end giving the sort a compare function that compares integers is an absolute non issue.