array-divide-equally
v0.0.4
Published
Evenly divide an array
Downloads
14
Readme
Array Divide Equally
Installation
npm install array-divide-equally --save
Usage
var divideEqually = require('array-divide-equally')
divideEqually([1, 2, 3, 4, 5, 6], 3)
//=> [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ]
divideEqually([1, 2, 3, 4, 5, 6, 7], 3)
//=> [ [ 1, 2, 3 ], [ 4, 5 ], [ 6, 7 ] ]
divideEqually([1, 2], 3)
//=> [ [ 1 ], [ 2 ] ]
Methods
- divideEqually(array) Divided Array
License
MIT