I have an Array
, which can vary from 1 - 600K
records. Therefore, I need to find a way to break this bigger array into smaller chunks and perform some operation of the smaller chunks.
How can I do this?
My solution as follows: My problem is that I am not sure, how many elements the array will contain so I am not able to divide it by 10, to determine the chunk size.
for(const i = 0 ; i < largeArray.length; largeArray.length/10) {
var p1 = largeArray.slice(i,whatisthechunksize);
}