3 ms·
> Please note that I wrote it's a broken implementation over weak typing, not of weak typing. But weak typing is a complete red herring, as I noted previously
by masklinn 13y ago
> Please note that I wrote it's a broken implementation over weak typing, not of weak typing.
But weak typing is a complete red herring, as I noted previously the behaviour of the default sort function is independent from the typing system, you could have a default sort function doing more or less the same thing in a very strict statically typed system.
Haskell's `sort` is defined (more or less) as
sort :: Ord a => [a] -> [a]
sort = sortBy compare
it could be (uselessly) defined as
sort :: Show a => [a] -> [a]
sort = sortBy (comparing show)
resulting in the same behaviour you see in javascript.
- weland 13y agoYes, of course it is a red herring! OP's rage was against the JS community taking it as an excuse for shity implementation, that's all I was trying to clarify...