I have a number of items in an array, say more than 14 items.
How can I group them into 2 different groups in this manner: The first 3 (#1,2,3) will be in array A, next 4 (#4,5,6,7) will be in array B, next 3 (#8,9,10) will be in array A, next 4 (#11,12,13,14) will be in array B and so on.
I tried using modulos, but half way through I realized that numbers with factors of 3 and 4 will not be able to be differentiated by using modulos.
I’m using Javascript/PHP for this, but any similar language is fine
For JavaScript: