Hi, so I completed the “Nesting For Loops” Challenge but don’t understand the challenge well and it seems that the challenge is now locked from comments. How does
for (var i=0; i < arr.length; i++) {
for (var j=0; j < arr[i].length; j++) {
console.log(arr[i][j]);
access arrays within:
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]);
}
}.
Since we are using .length, aren’t we accessing the length (5) rather than the value of stored in the array? Also, if there are three different arrays within var arr, how is it that var i and var j can access all three arrays? Wouldn’t a third variable be needed? Thanks!