Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

in-groups-of

0.0.1 • Public • Published

in-groups-of

Return an array of arrays in groups of N

Installation

$ component install component/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

Keywords

none

install

npm i in-groups-of

Downloadsweekly downloads

55

version

0.0.1

license

none

last publish

collaborators

  • avatar