Help me in this

Tell us what’s happening:

Please someone help me. I am not understanding how to code this.

Your code so far

function sum(arr, n) {
// Only change code below this line

// Only change code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36.

Challenge: Replace Loops using Recursion

Link to the challenge:

Recursion is hard to understand, but maybe these articles will help.

As far as this particular challenge, a hint is that it follows the example (multiple recursion) almost exactly, with only a few characters changed.