I know the recursion will call itself until its base case turns false, then the stack will unwind and be pushed into the array. I was thinking about nesting an for loop inside a if statement but this is where I get confused. @nhcarrigan
@nhcarrigan The output of one and five would be [1,2,3,4,5] and 24, and 29 would be [24,25,26,27,28,29] right if your using the unshift method. So, could I decrement the loop ?
You could decrement the loop, yes. Or you could use the .push() method to add to the end of the array and increment the loop. Either approach could work.