Skip to content

kimjoar/component-in-groups-of

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Split an array into groups of N

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%