Skip to content

index in .map #6

Description

@shimaore

Hi Adam,

It would be nice if .map would provide the index value as the second argument to its callback, or that the documentation clearly states that contrarily to Array::map, the index is provided as the third argument ;)

Typically, providing the index as second argument, one could write

lines.map (line,index) => …

or

lines().map (line,index) => …

(I'm a bit unclear on what the value currently provided in the second argument to enter would be, as well, but I haven't needed it.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions