I have an array like `[A,B,C,D]`. I want to access that array within a for loop like as

```
var arr = [A,B,C,D];

var len = arr.length;
for(var i = 0; i<len; i++){
    0 - A,B,C
    1 - B,C,D
    2 - C,D,A
    3 - D,A,B
}

```

I want to access that like in JavaScript, any ideas?