In the “Basic JavaScript: Replace Loops using Recursion” I have a hard time to understand well the logic behind this code:

```
function multiply(arr, n) {
if (n <= 0) {
return 1;
} else {
return multiply(arr, n - 1) * arr[n - 1];
}
}
```

For what I know is that this function multiply the numbers in the arrays starting from the first one to the n number. Example: multiply([1,2,3,4], 3) this will multiply 1 x 2 x 3 which result in 6. What I don’t understand is the

```
else {
return multiply(arr, n - 1) * arr[n - 1];
}
```

part. I don’t know how the multiplication in this line works and I don’t know why it would loop. Please can someone just explain me step by step what happens in this line code.