Nesting for loops - multiplying

Tell us what’s happening:
hi guys, don’t understand what means the orders which I uploaded.

Your code so far


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; j++) {
    product = product *= arr[i][j];
  }
}
// Only change code above this line
return product;
}

multiplyAll([[1,2],[3,4],[5,6,7]]);


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5.

Challenge: Nesting For Loops

Link to the challenge:

can you rephrase in a different way? I don’t understand what you are asking

yes sure:
multiplyAll([[1],[2],[3]]) should return 6

multiplyAll([[1,2],[3,4],[5,6,7]]) should return 5040

multiplyAll([[5,1],[0.2, 4, 0.5],[3, 9]]) should return 54
don’t get what does it mean!

it is the function call with an example of arguments and the output that the function should have when called like that

1 Like

also note that this is not correct,
expanding tbr shorthand syntax this is
product = product = product * arr[i][j]

you can’t use both = and *=, you need or one or the other, not both

1 Like

thanks for mentioning this point.

I know but I don’t get how it works. could u please explain one of them?

maybe review this challenge

1 Like