The exercise wants you to make a function that will take an integer and go through adding up its total - 1 each time, so i.e. 4 would be 4 + 3 + 2 + 1 = 10
function addUp(num) {
if (num === 1) return 1;
return num + addUp(num - 1);
}
This works, but I'm not sure how. If I used say 6 to me the return line would be 6 + 5 = 11; I'm not sure how this looping? Thanks