Comment on I'll just sort it myself

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

Not every use case can be the built-in default. I wouldn’t have made JS weakly typed if I were designing it, but once the decision was made to use weak typing it made sense to either have no default sort method or to have a default sort method that assumes a type.

What I’ve outlined for you is the interface for a comparator, not the implementation. You can type check and convert and do anything else you want under the hood of the comparator you write.

source
Sort:hotnewtop