Logo
Floppy disks: The save icon's origin story.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • Csharp Csharp
  • All Categories

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

HTTP 418: I'm a teapot

The server identifies as a teapot now and is on a tea break, brb

Wtf-js Memes

Posts tagged with Wtf-js

It's All There In The Specs, Bro

Javascript Programming Webdev
1 hour ago 20.8K views 0 shares
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.

Spotlight

GearScouts.com

Stop scrolling, start exploring! Find the gear that'll get you off the couch and into the wild. Compare power stations for off-grid adventures, flashlights for midnight hikes, and essentials that make the outdoors your playground. Get Outside →

Freenove Ultimate Starter Kit for Raspberry Pi ...

Freenove Ultimate Starter Kit for Raspberry Pi ...
Ad Shopping here maintains our collection of 'It worked yesterday' screenshots. 📸