Nested loop error

Nested loop error
0

#1

Can someone please explain why I’m getting this error?
link to exercise: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/nesting-for-loops/

function multiplyAll(arr) {
var product = 1;
// Only change code below this line
for (x =0; x < arr.length; x*=) {
for (y =0; y < arr[x].length; y *=){
product *= arr[x][y];
}
}
// Only change code above this line
return product;
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);

SyntaxError: unknown: Unexpected token (4:32)
2 | var product = 1;
3 | // Only change code below this line

4 | for (x =0; x < arr.length; x*=) {
| ^
5 | for (y =0; y < arr[x].length; y *=){
6 | product *= arr[x][y];
7 | }


#2

Look at the 3rd statements in your forloops. You are not specifiying which values you are multiplying those variables with.


#3

thanks, i changed it to (var x=0; x<arr.length; x*=[]) but things still don’t work


#4

First you need to understand what you are doing.

Why are you multiplying an array to x over and over again? What do you think that will do?