I mean to know in which order the interpreter reads the text. I completely do not understand why then the numbers are increasing when first decreasing, I have a hypothesis that they somehow reverse push, I do not understand because the array is formed at the end, although technically it can not be formed at the end, so it turns out that it is not formed at the end. Someone please explain
This is a complicated subject and this question gets asked a lot. If you search the forum for “countup” you will find a lot of explanations. Let us know if none of those work.
i dont know what topic, but ur code is saying if what u pass in as n(5) is lesser than 1 return an empty array else u should keep subtracting n - 1 i.e 5-1,4-1,3-1 still its lesser than 1 push the numbers into the array,hope it helps.
Its recursion,u can google about it
Is it possible to explain it in such a way that when a subroutine is executed, the whole stack of executions of these subroutines flies somewhere like a boomerang, and the main program goes on to push, then the boomerangs all come back and write themselves into the array? Maybe it’s not the best explanation, but it’s more or less the same?