ArrayChunk
Last updated
Was this helpful?
Chunks the array into an array of arrays of the specified size.
The final chunk may be shorter if the array does not divide evenly.
numbers = [ 1, 2, 3, 4, 5 ];
numbers.chunk( 2 ); // [ [ 1, 2 ], [ 3, 4 ], [ 5 ] ]
ArrayChunk(array=[array], length=[integer])array
array
true
The array to chunk.
length
integer
true
The size of each chunk.
Last updated
Was this helpful?
Was this helpful?
