I have a dynamic created array:
var myArray = ['content_1','content_2','content_3','content_4'];
Other times my array could have more items in as such:
var myArray = ['content_4','content_4','content_new','content_new','content_new','content_new','content_new'];
My if statement looks like:
if (myArray.length > 8) { //then do something }
If myArray
has more then 8 items in the array, create a new one, each array can only hold 8 items though. So my first array could have 40 items in, 20 items in, or more... I never know, how could I split these into dynamic arrays, is there a way I can do this?
After the 8th item in myArray
push those 8 into a new array, then the next 8 (if applicable) and so forth