How to multiply sub-array, and describe me about test case as well

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function multiplyAll(arr) {
var product = 1;
// Only change code below this line
var i;
var j;
for(i=0; i< arr.length; i++){
  for(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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36

Challenge: Nesting For Loops

Link to the challenge:

your code passes the challenge, what do you need explained?
There is a flaw with your for loops and variable definitions. First you define your variables on separate lanes, then you initialize their values in the for loops. You can simply define the variables directly in the for loop parenthesis( var i=0;).

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.