Question: how to cycle below values with javascript?

```
0, -120, -240, -360, -480, -600, -720

```

to get the output like

```
0 -120 -240 -360 -480 -600 -720 0 -120 -240 -360 -480 -600 -720 0 -120 -240 -360 -480 -600 -720 .....

```

Regards

Answer: 
Use nested `for` loops:

```
var cycles = 10;
var numbers = [0, -120, -240, -360, -480, -600, -720];
for (var i = 0; i < cycles; i++) {
    for (var j = 0; j < numbers.length; j++) {
        // concatenate here
    }
}

```

See this [fiddle](http://jsfiddle.net/jXxwu/).
Or:

```
var d = -120, n = 7, s = 0, c = n * 2, limit = d * n;
var result = []
while (c--) {
  result.push(s % limit);  
  s += d;
}
alert(result); // 0,-120,-240,-360,-480,-600,-720,0,-120,-240,-360,-480,-600,-720

```