chunk()

Takes an array, splits it up into chunks of a specified size and returns a new array containing said array chunks.

This function is valid in v2.13.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{Array} array
The array that will be used to make the chunks. This array will not be modified.
{number=} opt_chunkLimit Optional, Default:1
The maximum number of items in each chunk. All chunks will contain this amount of items with the exception of the final chunk.

Returns

{Array}
An array of arrays where each subarray contains a chunk of the values from array.