Tell us what’s happening:
Describe your issue in detail here.
In the text explaination of the challenge I don’t understand where how they evaluated the function. How did they come up with, multiply(arr, n) == multiply(arr, n - 1) * arr[n - 1] from,
function multiply(arr, n) {
let product = 1;
for (let i = 0; i < n; i++) {
product *= arr[i];
}
return product;
}
**Your code so far**
function sum(arr, n) {
// Only change code below this line
// Only change code above this line
}
//1 x n (stops when the index of arr is less than n)
//[4,6,8,6]
/* 1 * where n is first element so means i has to be less than 1
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Challenge: Replace Loops using Recursion
Link to the challenge: