array-reduce-group-by
A group-by function working with the built-in Array.reduce()
Install
$ npm install array-reduce-group-by
Usage
const arrayReduceGroupBy = ; 'Alpha' 'Beta' 'Animal' //=> {A: ['Alpha', 'Animal'], B: ['Beta']}
Make sure not to forget the {}
in the end!
API
arrayReduceGroupBy(keyFunc)
keyFunc
Type: (arrayElement) => string
Function to determine the key of a given array element