Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Object plus object is not a number :)

https://www.destroyallsoftware.com/talks/wat



That's because the first 'object' is a block instead of an object literal.


For another surprise, try assigning those empty objects to variables before adding. By itself,

{}+{}

doesn't mean what you might think it means.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: