Splits an array into chunks of a specified size.
The array to process.
The maximum size of each chunk. Defaults to 1.
1
A new array containing sub-arrays (chunks) of the specified size.
chunk([1, 2, 3, 4, 5], 2);// → [[1, 2], [3, 4], [5]] Copy
chunk([1, 2, 3, 4, 5], 2);// → [[1, 2], [3, 4], [5]]
1.0.0
Splits an array into chunks of a specified size.