Hacker News new | past | comments | ask | show | jobs | submit login

Those are great. I wish PHP had borrowed eq and ne. It does have . for strings, which makes things a little easier.

Since JS doesn't have any of those string operators, you end up with the fun example that was posted in the article. It will default to using + to concatenate the strings, but - is not defined to strings, so it converts them to numbers first and then applies the operator. Easy to remember once you know what's going on, but still irrational.




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

Search: