Basic JavaScript - Nesting For Loops - 127KSnvRfNudTotXfRny5

Hello

When I verify the results I get NaN.
Am I doing something wrong?

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

let product = multiplyAll([[5, 1], [0.2, 4, 0.5], [3, 9]]);

console.log(product);

  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0

Challenge: Basic JavaScript - Nesting For Loops

Link to the challenge:

This isn’t the correct syntax for indexing into nested arrays. What is the , doing for you?

1 Like

I don t know why I put that there.It works without, thank you.

1 Like

Are you sure you have seen a nested array element referenced this way?

I just started learning jscript. :sweat_smile: