A blog by Aaron Godin

On This Blog's Name

When I wanted to get back to writing about software, one of my goals was to find a fun name for the blog itself. I like that it’s separate from my actual name. Since I’m primarily invested in JavaScript, I thought, “why not name it after a silly JavaScript-ism?”

The string "[object Object]" is pretty common, in that developers see it all the time when they’re probably expecting something else. It’s the result of calling toString() on any object literal.

One hilarious moment when building the theme for this blog (which is made in hexo btw, highly recommended) was when I was trying to get the title for the blog to show up as it does now. With hexo, site information like the title is driven through a YAML file. My first shot was defining it as such:

title: [object Object]

Because of the way that YAML is parsed in js-yaml, this actually results in an empty string. Now, I wasn’t aware I could just wrap it in quotes, so I thought, “hexo is written in JavaScript… I bet I can just put an object literal here and js-yaml will call toString() on it!”

title: {}

And voila, the name of the blog appears just as I wanted it to. Thanks JavaScript!!