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/).
```
var arr = [0, -120, -240, -360, -480, -600, -720];
var count = 3;
var output = [];
for(var i = 0; i < count; i++)
{
   output = output.concat(arr);
}
alert(output);

```

[working code on fiddle](http://jsfiddle.net/gbsandeep/A4DHn/)