Just to be clear, it is not after “making” the call, but after finishing with it.
The whole thing might be clear if you understand how call stacks work. There is probably a good video on it. But, during that first call to the function, when it encounters the next function call, the “environment” of that current call gets “frozen” on the call stack and a new function begins. This happens 4 times until the last (5th call) happens and that function call can actually finish. Then JS looks on the latest thing on the call stack and finishes that, etc., turtles all the way down. It’s like it wraps itself up with incomplete function calls until it gets to the end and then unwraps, finishing the function calls.
If you run it this way:
function countup(n) {
console.log(n, '... entering countup');
if (n < 1) {
console.log(n, '... n < 1, returning []');
return [];
} else {
console.log(n, '... n >= 1, making recursive call with n');
const countArray = countup(n - 1);
console.log(n, '... back from recursive call');
countArray.push(n);
return countArray;
}
}