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

You can do literal comparison using ===

But the problem in my perception is that it is very error-prone. A less error-prone solution would be only convert one string value to number when the another is really a number. For example:

'9223372036854775807' == 9223372036854775808




> A less error-prone solution would be only convert one string value to number when the another is really a number.

That is, in fact, exactly how JS handles it.




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

Search: