Okay, so this is the idea.
1.I got an array with 12 numbers (a=[1,2,3,4,5,6,7,8,9,10,11,12]
2.I want to split it into 4 chunks so i did this...
a=[1,2,3,4,5,6,7,8,9,10,11,12];
var b = [];
while(a.length) {
b.push(a.splice(0,3));
}
This gave me an array with 4 elements with 3 values inside each element
i.e. [1,2,3,4] = [ 1 2 3 , 4 5 6 , 7 8 9 , 10 11 12 ]
3.Now my problem is that i would like it to be organized in a way that the first value goes into the first element, the second into the second, the third into the third, and the fourth into the fourth and it repeats the process until i got something like this:
i.e. [1,2,3,4] = [ 1 5 9 , 2 6 10 , 3 7 11 , 4 8 12 ]