i have array like this.This array has 100 elements and I want to split this array into different arrays with 20 elements.
const array=[];
for (let i = 0; i < 100; i++) {
array[i]=i;
}
I want to split this array into different arrays with 20 elements each. The arrays will be as follows =
array0=[0.. to 20]
array1=[1.. to 21]
array2=[2.. to 22] .
.
.
array80=[80..to 100]
How can I best solve this problem?
The reason why I separate the arrays this way is because I will be comparing them to each other at the end.