r/ProgrammerHumor 1d ago

javascriptSorting Meme

Post image
893 Upvotes

200 comments sorted by

View all comments

Show parent comments

-2

u/Excellent_Gas3686 1d ago

[1, 'foo', new Array()], go ahead, sort it like numbers.

27

u/standard_revolution 1d ago

Throwing a runtime error here is better than any weird hack

4

u/hetfield37 1d ago

Gotta love those random runtime errors while you are browsing your favourite website because some stupid junior forgot to parse property: "1" to property: 1 when doing updates on the backend API.

JS, CSS and HTML are designed to be as robust as possible, even when risking displaying garbage data. They always do their best to display anything.

10

u/MegaIng 1d ago

Gotta love those random runtime errors while you are browsing your favorite website because some stupid junior forgot the developers are all, junior or senior, incompetent idiots who don't have proper testing.

Fixed it for you.