I really have no idea how to solve this problem, can someone help me pls? Basic JavaScript: Replace Loops using Recursion

guys its like this and let me explain it:

function sum(arr, n) {

  // Only change code below this line

  if (n <= 0)// if n is less than or equals to 0{

    return 0 // should return zero

  } else {

    return sum(arr, n-1) + arr[n-1];

  }

  // Only change code above this line

}

sum([1],0);