I don’t know if this is something that kids do where you grow up, but there’s a game that goes like this.
I ask you “Wanna buy a duck?” and you respond with the question "Does it quack?"
If I am the kid who started the game I say “Of course it quacks!”
Now you have to find someone else. You ask them “Wanna buy a duck?” They ask you “Does it quack?” Now you have to go find me and ask me “Does it quack?” If I started the game I say “Of course it quacks!” If I bought the duck from someone else, I have to find them and ask “Does it quack?” After I tell you “Of course it quacks!” you have to find the kid you’re selling the duck to and say “Of course it quacks!”
The sale is never done until every person in the chain has verified that the duck quacks. We can only “turn around” after we hit the special condition of the kid who started the game.
When we create recursive functions, we return the result of calling the same function (with a modification to the result). The return in our current use of the function can not complete until every layer down the stack is complete. That starts when we hit a call to the function that doesn’t call itself. This is the “base case”. In our duck game it’s the kid who didn’t buy the duck from anyone. In factorials it’s when we are evaluating the factorial of
factorialize(0) doesn’t have to call
factorialize(-1). It’s the end of the line. That means that it can turn around and the return statement of
factorialize(1) can complete…which lets the return statement of
fatorialize(2) complete. And so on.