I’m quite confused about the principle of how the function is working here.
Can someone please explain how the line of code as const countArray = countup(n - 1); creates an array with necessary numbers in the correct order?
there has just been a post opened on this same thing
Could you take a look there (and at the threads linked in there) and see if it clear some ideas for you?
If it is not enough feel free to ask again! (Here, or in the thread where the post you want some clarifications on was written)
So, for the countup function, we are creating a const rather than declaring var is because, in this case, it stands for the number that gets pushed to the stack and it is the value they won’t be modified, that would be correct?