1 contributor
Like
Install index-by as a package?
Copied
npm i @bit/justin-capalbo.ramda.index-by
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
indexBy (
fn:
Function
,array:
) : Array
Object
Given a function that generates a key, turns a list of objects into an object indexing the objects by the given key. Note that if multiple objects generate the same value for the indexing key only the last value will be included in the generated object.
Acts as a transducer if a transformer is given in list position.
Example
Arguments
fn:
Function
Function :: a -> String
array:
Array
The array of objects to index
Returns
Object
An object indexing each array element by the given property.