For does not increment at the end of the loop

0

What I need is to get all the arrays that are returning to me, and separate them into groups of 5 and the rest into a separate group. In the example I'm going to paste, I have two arrays

Array1 = [1,2,3,4,5,6], Array2 = [1,2,3]

I need to add in a new array the indices [1,2,3,4,5] of array1, and in another new array the indices [6] of array1 and the indices [1,2,3] of array2

This is just an example, but I can get up to 4 different arrays with varying lengths, and I need to do the same thing, separate the groups of 5 from the rest.

In the code I'm going to pass to you, I'm having a problem with one of the for, which does not increment in the blocksGroup variable, then it ends up messing with everything. If anyone can help me solve the problem or even improve this code that for me is getting a bit confusing.

link

    
asked by anonymous 23.08.2018 / 19:06

0 answers