If you want to loop over a multidimensional Array then the process can look like:
for(var i in directions){
for(var n in direction[i]){
for(var q in directions[i][n]){
var innerIncrement = q, innerValue = directions[i][n][q];
}
}
}
Take into account that a for in loop will automatically make your indexes Strings. The following is a fail proof way to do the same thing, with some other help:
for(var i=0,l=directions.length; i<l; i++){
var d = directions[i];
for(var n=0,c=d.length; n<c; n++){
var d1 = d[n];
for(var q=0,p=d1.length; q<p; q++){
var innerIncrement = q, innerValue = d1[q];
}
}
}
When you do a loop like either of the above, imagine that each inner loop runs full circle, before the outer loop increases its increment, then it runs full circle again. You really have to know what your goal is to implement these loops.
-is, but don't know what your getting at. If you want to loop throughdirections[1][2]you can assign it to a variable and loop over it, since it is an Array.