Split Arrary into chunk
In this snippet, I would demonstrate a Util Function to split huge array into array chunks.
const chunkArray = (array, chunkSize) => {
const chunks = [];
for (let i = 0; i < array.length; i += chunkSize) {
chunks.push(array.slice(i, i + chunkSize));
}
return chunks;
}