417
submitted 1 year ago* (last edited 1 year ago) by kuneho@lemmy.world to c/programmer_humor@programming.dev

you are viewing a single comment's thread
view the rest of the comments
[-] heartlessevil@lemmy.one -4 points 1 year ago

I don't think JS works that way

[-] rikudou@lemmings.world 32 points 1 year ago
[-] Quasari@programming.dev 21 points 1 year ago* (last edited 1 year ago)

Array.prototype.sort if no callback is passed to it will coerce non-undefined elements to strings when sorting. It does do that.

To sort numbers passing a function like (a, b) => a - b is good enough.

[-] stratoscaster@lemmy.zip 16 points 1 year ago

Fuck JS is stupid.

Source: use JS regularly

this post was submitted on 07 Jul 2023
417 points (98.6% liked)

Programmer Humor

19187 readers
1203 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

founded 1 year ago
MODERATORS