I’m just wondering what I am getting wrong with this code for failing to pass:
function multiplyAll(arr) {
var product = 1;
// Only change code below this line
var arr = [ [1,2], [3,4], [5,6,7] ];
for (var i=0; i < arr.length; i++) {
for (var j=0; j < arr[i].length; j++) { product *= arr[i][j];
}
}
// Only change code above this line
return product;
}
hi, you don’t have to define arr, the challenge will give it to your function as input.
In your current code no matter what the challenge gives as input (e.g. arr=[[1],[22],[3]]), your function still outputs the result for arr = [ [1,2], [3,4], [5,6,7] ].