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

If it does anything at all, it certainly shouldn't generate NaN


Why not? If (+) is numeric addition and coercion is free then {} is NaN and so is {} and so is NaN + (anything) and so is (anything) + NaN.

Which is not to say that it's a good choice, but instead to say that the badness stems from overloading (+) too much and having free coercion.




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

Search: