Hello! I was going through Basic JavaScript - Replace Loops using Recursion, and couldn’t understand the base case of the example (multiply function).

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

I get how and why it works when n > 0. But if I call this function with n as 0,

```
multiply(arr, 0);
```

It will return 1. Isn’t it simply wrong? Shouldn’t it return a string of error message or something?

Or is it possible to do this

```
if (n <=0) {
return "Wrong input";
}
```

and set base case differently?

Thanks in advance!