Logo
The code works on my machine :shrug:
  • 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 Webdev Debugging
8 hours ago 529.5K 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

Windows User And Linux User

Windows User And Linux User

Linux
121.1M views 15 days ago
One Blood Eagle Please

One Blood Eagle Please

Debugging
314.2K views 5 months ago
The Perfect Date: Async In Rust

The Perfect Date: Async In Rust

Rust
407.0K views 1 year ago