just-group-by
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

just-group-by

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-group-by
yarn add just-group-by

Return a grouped object from array

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] }

Package Sidebar

Install

npm i just-group-by

Weekly Downloads

11,427

Version

2.2.0

License

MIT

Unpacked Size

5.93 kB

Total Files

9

Last publish

Collaborators

  • angus-c