Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

index in .map #6

Open
shimaore opened this issue Aug 21, 2018 · 0 comments
Open

index in .map #6

shimaore opened this issue Aug 21, 2018 · 0 comments

Comments

@shimaore
Copy link

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant