Hi,
I read the discussion, but still failing to understand this bit of code: why is the following?
multiply(arr, n) == multiply(arr, n - 1) * arr[n - 1]
Could someone please break it down into what is where?
Sorry if the question seems dumb, but I don’t want to move on until I fully understand what’s happening here
Many many thanks!
Describe your issue in detail here.
Your code so far
function sum(arr, n) {
// Only change code below this line
let product = 1;
// Only change code above this line
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Replace Loops using Recursion
Link to the challenge: