1.1.2 • Published 7 years ago

@pirxpilot/in-groups-of v1.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

in-groups-of

Return an array of arrays in groups of N

Installation

$ npm install @pirxpilot/in-groups-of

Example

var nums = [1,2,3,4,5,6,7,8,9,10];

inGroupsOf(nums, 5)
// => [[1,2,3,4,5], [6,7,8,9,10]]

inGroupsOf(nums, 4)
// => [[1,2,3,4], [5,6,7,8], [9,10]]

inGroupsOf(nums, 2)
//=> [[1,2], [3,4], [5,6], [7,8], [9,10]]

License

MIT