4 ms·
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
by alexk7 7y ago
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.
- cbm-vic-20 7y ago> don't assume it's similar to the same named function from every other language
- lucideer 7y agoNot every language has such a function. Even languages that do have different versions of it on different objects (e.g. Scala's zipWithIndex)
- happytoexplain 7y agoIt'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.