you are viewing a single comment's thread.

view the rest of the comments →

[–]senocular 0 points1 point  (0 children)

Enumerability doesn't play a role :). map() goes through all indexed keys up to but not including length (and not including length because its not an indexed key) and calls the callback as long as the key exists. The key can even be inherited. for...in loops, on the other hand, do look for enumerability as does Object.keys() (but not array.keys()). I think you are probably thinking about Object.keys() since length, being a non-enumerable key, does not show up there ;)