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

The problem there isn't with coercion, it's with + being both addition and concatenation, as I mentioned at the end of my comment.

If you use any other operator (any reasonable operator), it works: "1" - 1 === 0, "1" - "1" === 0 and 1 - 1 === 0.



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

Search: