I have a loop
for (var i=0; i < x; i++){
// ..
}
I want to wrap each 8 numbers between two characters. So my output would look something like this:
< 0 1 2 3 4 5 6 7 > < 8 9 10 11 12 13 14 15 > < 16 17 18 19 20 21 22 23 > < ...
My solution was
if(i == 0) console.info('<');
if(i == 7) console.info('>');
if(i == 8) console.info('<');
if(i == 15) ...
But this would be pretty verbose. Is it possible to make this task easier?