News for hackers. Stuff that matters.
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in... by alexk7 on Friday June 21, 2019 @11:26AM (#20243339)
This is not one of the weird things about Javascript. When you use a function (like map), always check the documentation to know its behaviour and don't assume it's similar to some similarly named function from another language. End of story.
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in... by happytoexplain on Friday June 21, 2019 @11:49AM (#20243561)
It's bewildering to me that one can look at the sheer volume of confusion generated by things like this and insist that it's not confusing.
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in... by cbm-vic-20 on Friday June 21, 2019 @11:45AM (#20243516)
> don't assume it's similar to the same named function from every other language
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in... by lucideer on Friday June 21, 2019 @11:52AM (#20243588)
Not every language has such a function.

Even languages that do have different versions of it on different objects (e.g. Scala's zipWithIndex)