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.
Even languages that do have different versions of it on different objects (e.g. Scala's zipWithIndex)