Can any one tell me what's wrong with this code. Error getting arr[i] is undefined why? I am totaly confused

Can any one tell me what's wrong with this code. Error getting arr[i] is undefined why? I am totaly confused
0

#1

function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for (var i = 0; i < arr.length; i++) {
for (var j = 0; j < arr[i].length; i++) {
product *= arr[i][j];
}
}
// Only change code above this line
return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);


#2

Look at your second for loop.
Pay attention to the variable :slight_smile:


#3

Sorry i am idiot. I have to replace i++ with j++. Thanks