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

get the key in async.each? #380

Closed
btmdave opened this issue Sep 22, 2013 · 5 comments
Closed

get the key in async.each? #380

btmdave opened this issue Sep 22, 2013 · 5 comments

Comments

@btmdave
Copy link

btmdave commented Sep 22, 2013

Is there a way to get the key associated to the array item being processed within async.each?

Thank you!

@Volox
Copy link

Volox commented Oct 8, 2013

+1

1 similar comment
@gewfy
Copy link

gewfy commented Jan 5, 2014

+1

@juanpaco
Copy link

juanpaco commented Jan 7, 2014

I'm in need of this one too. I'm happy to submit a pull request.

To get the discussion going, which way of fixing this is preferred?

  1. Supply an iterator with arity of 3 to get the index (e.g. function(item,i,next))
  2. New API functions to get the index (e.g. eachWithIndex and eachWithIndexSeries)

I favor the first option, but does that risk breaking people's iterators that expect the 2nd argument to be the callback?

@juanpaco
Copy link

juanpaco commented Jan 7, 2014

Related to #321, #264, #72

@theoephraim
Copy link

+1

@caolan caolan closed this as completed Mar 28, 2014
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

6 participants