Splits an array into smaller batches of a specified maximum size
The input array to split
The maximum size of each batch. If zero, return the array as a single batch.
An array of batches, where each batch is an array of the original elements
Splits an array into smaller batches of a specified maximum size