Logo
DNS: The internet's phone book, but slower.
  • Home
  • Hot
  • Random
  • Search

Browse

  • AI AI
  • AWS AWS
  • Agile Agile
  • Algorithms Algorithms
  • Android Android
  • Apple Apple
  • Azure Azure
  • Backend Backend
  • Bash Bash
  • C++ C++
  • Cloud Cloud
  • All Categories
As an Amazon Associate ProgrammerHumor.io earns from qualifying purchases.

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

Object-to-string Memes

Posts tagged with Object-to-string

A Good Name For The Variable: "" + {}

Javascript Programming Debugging Webdev
1 month ago 2.3M views 0 shares
A Good Name For The Variable: "" + {}
The documentation tells you to name variables based on what they contain. So naturally, if your variable contains an object, you should call it [object Object] . You know, because that's what JavaScript returns when you try to convert an object to a string. Perfect naming convention, right? The joke here is that "" + {} is JavaScript's delightful way of coercing an empty object into a string, which gives you the utterly useless "[object Object]" . It's the programming equivalent of asking someone their name and they respond with "I am a person." Every JavaScript developer has seen this cursed string in their console at least a hundred times, usually when they forgot to properly stringify something. It's become the universal symbol of "oops, I didn't handle this object correctly."

Today's picks

Mesh Desk Organizer with Drawer, 9-Compartment Pen Holder for Desk, Black

Mesh Desk Organizer with Drawer, 9-Compartment Pen Holder for Desk, Black

Affiliate
$11.99
It's-A The Ubuntu Bros!

It's-A The Ubuntu Bros!

Linux
386.1K views 1 year ago
Actually happened to me

Actually happened to me

Programming
114.9K views 5 years ago