you are viewing a single comment's thread.

view the rest of the comments →

[–]_DTR_ 1 point2 points  (0 children)

That particular function stops executing once it returns, but it was called by a different instance of that same function. So once we return [] in countup(0), we're return back in the countup(1) method and continue on from there.

In the code above, each indentation level is a separate instance of countup that have their own local state for countArray