arr= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
how to dynamically fetch data according to the step size of this array?
var arr=[1,2,3,4,5,6,7,8,9,10]
var eachGroup=[]
for(var i=0;i<arr.length/3;iPP){
tmp=[]
tmp.push(i);
while(i+3<arr.length){
tmp.push(i+3);
}
eachGroup.push(tmp)
}
console.log(eachGroup)