How to Split an Array into Even Chunks in JavaScript - Stack Abuse
https://stackabuse.com/how-to-split-an-array-into-even-chunks-in-javascript/
WEBAug 25, 2021 · So, to slice a list or array into even chunks, let's use the slice() method: function sliceIntoChunks ( arr, chunkSize ) { const res = []; for ( let i = 0 ; i < arr.length; i += chunkSize) { const chunk = arr.slice(i, i + chunkSize); res.push(chunk); } return res; } const arr = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]; console .log ...
DA: 76 PA: 96 MOZ Rank: 67