Nested loops challenge won't run tests

Tell us what’s happening:
There seems to be a syntax error on line 12 , but the issue is I didn’t edit any code in line 12, and this error is preventing me from moving on in this challenge

  **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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36 Edg/92.0.902.67

Challenge: Nesting For Loops

Link to the challenge:

Hello :slight_smile:!

Hmmm… When the interpreter tells you that there is a syntax error on line N, it doesn’t necessarily means that the error is in that specific line because it may be on a previous line.

In this case, you forgot to close the first for loop, hence the error:

function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for ( var i = 0; i < arr.length; i++) { // Here your for starts
    for (var j = 0; j < arr[i].length; j++)
      product = product * arr[i][j]
  // and it should be closed here
  // Only change code above this line
  return product;
}

I hope it helps :slight_smile:,

Regards!

1 Like

Thank you so much, I see where my mistake was

1 Like

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