even-chunks
Split an array evenly into chunks.
Install:
npm install even-chunks
const evenChunks = ; // => [ [ 1, 2, 3, 4 ], [ 5, 6, 7 ] ] // => [ [ 1, 2 ], [ 3, 4, 5 ], [ 6, 7 ] ] // => [ [ 1, 2 ], [ 3, 4 ], [ 5 ], [ 6, 7 ] ] // => [ [ 1, 4, 7 ], [ 2, 5 ], [ 3, 6 ] ] // => [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8 ], [ 9, 10 ] ] // => [ [ 1, 2 ], [ 3, 4, 5 ], [ 6, 7, 8 ], [ 9, 10 ] ] // => [ [ 1, 2 ], [ 3, 4 ], [ 5, 6, 7 ], [ 8, 9, 10 ] ]
License
MIT