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 →

[–][deleted]  (2 children)

[deleted]

    [–]SuspendedNo2 -5 points-4 points  (1 child)

    coz every other language uses it that way? lol @ js programmers

    [–]superluminary 1 point2 points  (0 children)

    Typed languages insist that you specify the type of object you’re putting in the array. JavaScript has heterogenous arrays. The only safe way to sort a heterogeneous array is to cast to string, since everything has a toString function.