Tell us what’s happening:
Hey there, first time posting here 
I spent the entire night on the recursive concept trying to grasp it and it’s starting to make sense.
But I could not find an answer for this question of mine anywhere.
Why is the (n = 0) condition not enough?
Why is it absolutely necessary to have (n <= 0) here?
EDIT: just thought about it some more, is it because it might trigger an infinite loop if the number is negative?
**Your code so far**
function sum(arr, n) {
// Only change code below this line
if (n = 0) {
return 0;
} else {
return sum(arr, n - 1) + arr[n - 1];
}
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:86.0) Gecko/20100101 Firefox/86.0.
Challenge: Replace Loops using Recursion
Link to the challenge:
