this post was submitted on 07 Jul 2023
303 points (98.1% liked)
Programmer Humor
27341 readers
962 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments

I don't think JS works that way
It does.
Array.prototype.sortif no callback is passed to it will coerce non-undefinedelements to strings when sorting. It does do that.To sort numbers passing a function like
(a, b) => a - bis good enough.Fuck JS is stupid.
Source: use JS regularly