News for hackers. Stuff that matters.
Re:Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in... by kbp on Friday June 21, 2019 @12:05PM (#20243733)
The part that is relatively unique to JS is where extra arguments passed to a function are silently ignored. In most every other language, the function passed to map takes 1 argument, which is also the common case in JS. But JS always passes 3 arguments to that function. I don't think it's optional parameters that people find confusing, it's the interplay between optional parameters and functions whose interface depends on functions they accept as arguments ignoring extra arguments.

There are no comments on this comment yet.