So I guess you mean the terminating case is the base case and the recursive case also needs a return. It just seems odd to me to return the recursive call, but I did and it worked. Thx.
Don’t let the fact that it’s a recursive function call throw you. It’s still really just a regular function call, just like you would call any other function. Let’s take this trivial example:
function myRound(num) {
return Math.round(num);
}
Do you have a problem understanding that num is passed into Math.round and then the value returned by Math.round is then returned by myRound? This is exactly what is happening with a recursive function call. The only difference is that you are calling the same function again. But you still need to return a value for the original function call.