The array to split into chunks.
The maximum size of each chunk.
Optional
fromLeft: booleanIf true
, splits the array from left to right. If false
or omitted, splits from right to left, placing the smaller chunk (if any) at the start.
An array of arrays, where each sub-array is a chunk of the original array.
Splits an array into chunks of a specified size.