var arr = [

[1,2], [3,4], [5,6]

];

for (var i=0; i < arr.length; i++) {

for (var j=0; j < arr[i].length; j++) {

console.log(arr[i][j]);

}

}

firstly i === 0 so we check the length of arr which is 3 and i becomes one. i is now the first part of the arr ([1,2]). Then j runs against i and comes back with 1 as i === 1 so now j === i === 1 so the console returns arr[i][j] which === arr[1][1] which is arr[1][2].

am I way off the mark here? I seem to be having a real struggle with for loops. If its wrong can someone break the code down for me and explain it please. Thanks a lot.