Comment on I'll just sort it myself

<- View Parent
CheezyWeezle@lemm.ee ⁨1⁩ ⁨year⁩ ago

Right, but you have to make that comparator yourself, it’s not a built-in part of the language. The only built-in comparator converts values to strings and compares them in code units orders.

Also, that technically isnt type-safe, is it? If you threw a string or a NaN at that it would fail. As far as I knew, type safe means that a function can handle type errors itself, rather than throwing an exception. So in this case the function would automatically convert types if it was type-safe to prevent an unhandled exception.

source
Sort:hotnewtop