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

I really like this "1-1" answer. That's very creative :)

But honestly, compare each one of these answers to js's official workaround calling the Number() constructor on the primitive string value and attempting to convert to a number since the subtraction operator is only defined for number and then proceeding to complete the operation.

For me, it looks very logical and convincing given that the language is loosely typed and it breaks her heart that it fails any of its loved users :)



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

Search: