Function chunkify

Returns an array of arrays, where each subarray contains a maximum of chunkSize elements from the input source array.

If chunkSize is less than or equal to 0, the entire source array is returned as a single chunk.

Chunkify

const a = [1, 2, 3, 4, 5, 6, 7, 8];
const b = chunkify(3)(a);
console.log(b); // [[1, 2, 3], [4, 5, 6], [7, 8]]