return a grouped object from array
npm install just-group-byPart of a library of zero-dependency npm modules that do just do one thing.
Guilt-free utilities for every occasion.
``shell`
npm install just-group-by`shell`
yarn add just-group-by
Return a grouped object from array
`js
import groupBy from 'just-group-by';
groupBy([6.1, 4.2, 6.3], Math.floor); // { '4': [4.2], '6': [6.1, 6.3] }
groupBy([1,2,3,4,5,6,7,8], function(i) { return i % 2}); // { '0': [2, 4, 6, 8], '1': [1, 3, 5, 7] }
``