3 ms·
> So if I'm understanding correctly, JS sort sorts numbers by their string value? That's crazy. It's JavaScript … it doesn't have to be sane; we'll use it anyw
by zeveb 11y ago
> So if I'm understanding correctly, JS sort sorts numbers by their string value? That's crazy.
It's JavaScript … it doesn't have to be sane; we'll use it anyway.
I think that Erlang had the most elegant solution: it defines a total order over all objects (number < atom < reference < fun < port < pid < tuple < list < bit string). Of course, Erlang's 'strings' are pretty inelegant (they're just lists of integers, which are printed as strings if they happen to incidentally be valid characters), so I guess there's some Law of Conservation of Bogosity at play here.