The array to split into chunks
The maximum size of each chunk
An array of arrays, each containing up to 'size' elements
chunkArray([1, 2, 3, 4, 5], 2) // [[1, 2], [3, 4], [5]]
chunkArray([1, 2, 3, 4], 3) // [[1, 2, 3], [4]]
chunkArray([1, 2, 3], 1) // [[1], [2], [3]]
chunkArray([], 2) // []
Generated using TypeDoc
Breaks an array into smaller chunks of the specified size.
✅ Works in Node.js, React, and React Native.