I have an array with 6 strings representing HTML image tags. I have some code which determines an amount of space to fill with these images.
I am using a loop, which works fine to pull from these 6 images and use 1 or all 6. My issue comes when I need MORE than 6, which would mean go through the array again and again. I am unsure how to best construct this loop. Currently I have
for (var i = 0; i < numAds ; i++) {
$('#primary').append(adList[i]);
};
I tried adding if (i > adList.length) { i=0 } before the jquery statement but then I got stuck in a loop and crashed the browser.
What am I missing here?