Hi, the function should build columns, say you have only 9 indexes and build 3 columns:
Say array is [0,1,2,3,4,5,6,7,8]
Your columns will be:
0 3 6 1 4 7 2 5 8
That's the output in the console, of course the 'columns' can be simple arrays, but the elements have to be pushed onto them like this.
Also, if instead of 9 items you have say 11 -> [0,1,2,3,4,5,6,7,8,9,10], your output will be similar but the last column will be incomplete:
0 3 6 9 1 4 7 10 2 5 8
Hope this clarifies it a bit.
Thanks for reaching out =).
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, the function should build columns, say you have only 9 indexes and build 3 columns:
Say array is [0,1,2,3,4,5,6,7,8]
Your columns will be:
0 3 6
1 4 7
2 5 8
That's the output in the console, of course the 'columns' can be simple arrays, but the elements have to be pushed onto them like this.
Also, if instead of 9 items you have say 11 -> [0,1,2,3,4,5,6,7,8,9,10], your output will be similar but the last column will be incomplete:
0 3 6 9
1 4 7 10
2 5 8
Hope this clarifies it a bit.
Thanks for reaching out =).