Hi I an new to programming and am experiencing looping problems. I have two arrays :
colour = ['red','blue','green','orange'];
rows = [1,2,3,4,5,6,7,8,9,10,11...];
I want to have each row element pair with a colour from the colour array, for example starting
rows[0]=>colours[0],
rows[1]=>colours[1],
rows[2]=>colours[2],
rows[3]=>colours[3],
rows[4]=>colours[0],
rows[5]=>colours[1],.....
I basically want to start iterating over the colours once they runout
rows.forEach(function (v, i) { rows[i] = colour[i%4]; });