I want to understand this lesson

If you reread what I wrote, I wasn’t talking specifically about my replies.

I have make comments on this function here. I also make discussion here and here.

I’m sure there are others. There are also countless discussions.

Looking more closely at your question, it looks like it has nothing to do with recursion. (Sorry, I have a knee jerk reaction to the never ending flow of recursion questions.

how could this constant has push

    const countArray = countup(n - 1);
    countArray.push(n);

People misunderstand const in JS. It is saying that countArray cannot be changed. But what is countArray? It is not an array, it is a “reference type” so it is a memory address, a “reference”, that points to the place in memory. The const is saying that that memory address cannot change. But what is stored in that memory location, that can change. Yes, I know, it seems a bit odd, but that’s how JS works. For primitive types (string, number, boolean, etc.), const works the way you expect. But for reference types (objects, functions, arrays, etc.) it works like this. You can change what’s in the memory location. If you want to keep that from being changed, you have to do a freeze.