DEV Community

Discussion on: JavaScript is bananas

Collapse
 
icecoffee profile image
Atulit Anand • Edited

Earlier I was trying to make an error and I got this.lol

Collapse
 
drochetti profile image
Daniel Rochetti

haha yep, same root cause. The object gets converted to a string, "[object Object]" and then appended to the number, which is also converted to a string.

Long story short, when JS doesn't know what to do, it converts everything to a string and call it a day.