In the function, `arr`

is a list of array’s, each of those nested array’s contains numbers.

```
[
[1, 2],
[3, 4],
[5, 6, 7]
]
```

The first `for`

loop iterates over the outer array, so the variable `i`

is an index number that references one of the inner arrays.

The second `for`

loop then iterates over the current inner array, as referenced by `arr[i]`

. On each iteration of the inner array, it multiplies the current value of `product`

with the number in the inner array, and saves the result back into `product`

.

After it is done iterating the inner loop, it logs the current value of product.

Give the variables more verbose name and add some extra variables to make it more readable, then follow the code, substituting the values as you go.

```
function multiplyAll(listOfLists){
let product = 1;
// Only change code below this line
for (let listIndex = 0; listIndex < listOfLists.length; listIndex++){
let listOfNumbers=listOfLists[listIndex];
for (let numberIndex = 0; numberIndex < listOfNumbers.length; numberIndex++){
let currentNumber=listOfNumbers[numberIndex];
product = product * currentNumber;
}
console.log(product)
}
// Only change code above this line
return product;
}
```

Following the code:

```
let product = 1;
```

Set `product=1`

```
for (let listIndex = 0; listIndex < listOfLists.length; listIndex++){
```

First iteration, `listIndex=0`

```
let listOfNumbers=listOfLists[listIndex];
```

Set listOfNumbers equal to `listOfLists[0]`

Now `listOfNumbers=[1, 2]`

```
for (let numberIndex = 0; numberIndex < listOfNumbers.length; numberIndex++){
```

First iteration of inner loop. `numberIndex=0`

```
let currentNumber=listOfNumbers[numberIndex];
```

Set `currentNumber`

equal to `listOfNumbers[0]`

.

Now `currentNumber=1`

```
product = product * currentNumber;
```

Multiply `product`

(1) by `currentNumber`

(1), store the result (1) into `product`

.

Now, `product=1`

```
for (let numberIndex = 0; numberIndex < listOfNumbers.length; numberIndex++){
```

Second iteration of inner loop. `numberIndex++`

Now `numberIndex=1`

```
let currentNumber=listOfNumbers[numberIndex];
```

Set `currentNumber`

equal to `listOfNumbers[1]`

.

Now `currentNumber=2`

```
product = product * currentNumber;
```

Multiply `product`

(1) by `currentNumber`

(2), store the result (2) into `product`

.

Now, `product=2`

```
console.log(product)
```

Log the value of `product`

(2) to the console.

```
for (let listIndex = 0; listIndex < listOfLists.length; listIndex++){
```

Second iteration, `listIndex++`

Now `listIndex=1`

```
let listOfNumbers=listOfLists[listIndex];
```

Set listOfNumbers equal to `listOfLists[1]`

Now `listOfNumbers=[3, 4]`

```
for (let numberIndex = 0; numberIndex < listOfNumbers.length; numberIndex++){
```

First iteration of inner loop. `numberIndex=0`

```
let currentNumber=listOfNumbers[numberIndex];
```

Set `currentNumber`

equal to `listOfNumbers[0]`

.

Now `currentNumber=3`

```
product = product * currentNumber;
```

Multiply `product`

(2) by `currentNumber`

(3), store the result (6) into `product`

.

Now, `product=6`

```
for (let numberIndex = 0; numberIndex < listOfNumbers.length; numberIndex++){
```

Second iteration of inner loop. `numberIndex++`

Now `numberIndex=1`

```
let currentNumber=listOfNumbers[numberIndex];
```

Set `currentNumber`

equal to `listOfNumbers[1]`

.

Now `currentNumber=4`

```
product = product * currentNumber;
```

Multiply `product`

(6) by `currentNumber`

(4), store the result (24) into `product`

.

Now, `product=24`

```
console.log(product)
```

Log the value of `product`

(24) to the console.

And keep going…

You need to learn to read code like this if you want to learn to program. Code reading and analysis is something that applies to all languages, not just JavaScript.