The Sort Of Surprise Every JavaScript Developer Deserves

The Sort Of Surprise Every JavaScript Developer Deserves
javascript-memes, array-sort-memes, programming-gotchas-memes, web-development-memes, lexicographical-sorting-memes | ProgrammerHumor.io

Innocent newbie: "I'll just use array.sort() to sort these numbers!"

JavaScript: *sorts lexicographically* "Did I stutter?"

Nothing says "welcome to JavaScript" quite like discovering your numbers are being sorted as strings. That moment when you realize you need array.sort((a,b) => a-b) and question all your life choices that led you to web development.

It's basically JavaScript's hazing ritual - "Oh, you thought programming would make sense? That's adorable."

More Like This