Logo
Keep calm and git commit.
  • 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

Javascript-objects Memes

Posts tagged with Javascript-objects

It's All There In The Specs, Bro

Javascript Programming Webdev
3 months ago 212.3K 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 →

MINISFORUM UN1250 Mini PC i5 Intel Core i5-1250...

MINISFORUM UN1250 Mini PC i5 Intel Core i5-1250...
Ad Buy = You get cool stuff + we can finally fix that one bug that's been in production since 2017. 🐞