Logo
The first computer mouse had only one button.
  • 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
20 days 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

Worlds Best Web Developer Ceramic Mug, Red/White

Worlds Best Web Developer Ceramic Mug, Red/White

Affiliate
$16.99
I Don't Trust Myself

I Don't Trust Myself

Programming
377.0K views 10 months ago
They did my man Ben dirty !

They did my man Ben dirty !

Programming
94.1K views 4 years ago