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

Add _.indexBy #1008

Closed
wants to merge 2 commits into from
Closed

Add _.indexBy #1008

wants to merge 2 commits into from

Commits on Mar 8, 2013

  1. Add _.indexBy

    `_.groupBy` could be used for this as well but I feel like doing this:
    `grouped[attr][0]` is kinda ugly.
    
    I think it's quite often that you want to create a lookup table where
    you map each object some unique attribute.
    
    If the key iterator doesn't generate unique keys the last value for each
    key is used.
    ansman committed Mar 8, 2013
    Copy the full SHA
    ae34217 View commit details
    Browse the repository at this point in the history
  2. Alias _.indexBy to _.toLookup

    ansman committed Mar 8, 2013
    Copy the full SHA
    9ba84d4 View commit details
    Browse the repository at this point in the history