Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Split an array into groups of N
JavaScript
branch: master

Merge pull request #3 from repoify/add/repository

Add repository field to readme
latest commit eb8b084bd4
@jonathanong jonathanong authored
Failed to load latest commit information.
test
.gitignore
Makefile Initial commit
Readme.md
component.json Release 1.0.0
index.js
package.json

Readme.md

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

Something went wrong with that request. Please try again.