Hey guys, thx for stopping by my question.

While studying **[Replace Loops using Recursion]** on the FCC tutorial,

An idea came up that I want to build a function using recursion

that SUMS ALL THE ELEMENTS AUTOMATICALLY in an array.

So I tried with this one.

```
let multiArr = [1,2,3,4,5];
let n = multiArr.length;
console.log(n);// 5
function multiply(arr, n){
if( n <= 0 ){
return 1;
} else {
return arr[ n - 1 ] * multiply(arr, n - 1);
}
}
console.log(multiply(multiArr, n)) // 120
let newArr = [1,2,3,4,5,6];
let n2 = newArr.length; // 6
console.log(multiply( newArr, n2)); //720
```

But As you can see, you have to set ‘n’ for each array which is kind of annoying …

So, how can I build a function using recursion that sums all the elements in an array without taking care of ‘n’?!..

Thanks in advance!!