Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
cellis
on June 21, 2019
|
parent
|
context
|
favorite
| on:
Why ['1', '7', '11'].map(parseInt) returns [1, NaN...
Recently I learned that in Javascript,
[5 * 5] * 2 // 50 [5 + 5] * 2 // NaN 1 + [5 * 5] * 3 // 76 1 + [5 * 5] - 1 // 124
Interestingly, even Typescript will not ( by default ) catch this class of bugs.
megous
on June 21, 2019
[–]
[5+5]*2 is not NaN
cellis
on June 21, 2019
|
parent
[–]
True, I was playing around to get examples in runJS. I think I mis pasted that one. Oh well.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: