I couldn’t believe it, tried it out, what the actual heck? I mean I get all these weird string vs number comparison but sorting actual numbers and this comes out? What kind of drugs were the designers of javascript (or at least this function) on… Who thought it was a good idea to sort numbers lexicographically??
I couldn’t believe it, tried it out, what the actual heck? I mean I get all these weird string vs number comparison but sorting actual numbers and this comes out? What kind of drugs were the designers of javascript (or at least this function) on… Who thought it was a good idea to sort numbers lexicographically??
Probably meth or cocaine, considering js was written by a single person in 10 days
Patent-pending Meth-o-caine! Now with as much caffeine as four shots of espresso, and enough vitamin B to floor a polar bear!
Meth-o-caine! “TAKE THAT, LIVER!”
Available at your local Staples or Office Depot.
That way they get to reuse the code for sorting strings!
Iirc Array.sort requires you to pass a function in, or it casts into strings and sort them.