Quirks Memes

Posts tagged with Quirks

It's All There In The Specs, Bro

It's All There In The Specs, Bro
So you're telling me that accessing an array with a negative index in JavaScript not only works but actually adds a property to the array? And then when you check the array, it shows you this cursed -1: 4 sitting there like it belongs? The bell curve perfectly captures the JavaScript experience: beginners think it's ridiculous (correct), experts also think it's ridiculous (also correct), but the middle crowd has Stockholm syndrome and will defend it with their lives. "It makes sense bro, everything in JS is an object!" Yeah, and that's exactly the problem. JavaScript treats arrays like objects because they are objects, so test[-1] = 4 is just adding a property named "-1" to your array object. It's technically in the spec, which somehow makes it worse.

If Only Brendan Eich Had One More Day

If Only Brendan Eich Had One More Day
IMAGINE THE UTOPIA WE WERE ROBBED OF! 😭 JavaScript, the language that powers 99% of the web, was infamously created by Brendan Eich in just 10 DAYS back in 1995. TEN. DAYS. The result? A language with more quirks than a cat café on catnip! One more day could have fixed the nightmare that is type coercion, the existential crisis of null vs undefined , and that absolute TRAVESTY where [] + [] equals an empty string but [] + {} is "[object Object]"! The audacity! Now we're all stuck patching this cosmic joke with TypeScript like putting designer bandaids on a coding catastrophe. Just ONE more day, Brendan! We could've had flying cars instead of framework fatigue!