Basic JavaScript - Nesting For Loops - 127KSnvRfNudTotXfRny5


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]]);


  **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

I just started learning jscript. :sweat_smile:

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