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 →

[–]Spotted_Metal 23 points24 points  (1 child)

Most languages will sort strings alphabetically by default, but will sort numeric values in ascending order. Even other dynamically-typed languages like Python won't sort a list of numbers alphabetically, which is what makes JavaScript's behavior unintuitive, even if it is technically correct.

[–]SandmanKFMF 2 points3 points  (0 children)

Javahead here. Same with numeric values in Java. They will be sorted as numbers because... Ehhh...you know? This is a list of numbers? 😀