first think of ‘n’ as 5.
if n is less than 1 then return an array,
else (if the n is greater or equal 1) get the return value of countup(5-1)
and push to that value n (which is 5).
what is the value of countup(5-1)
in other words countup(4)
?
‘n’ in this context is 4.
if n is less than 1 it return an array,
else (if the n is greater or equal to 1) get the value of countup(4-1)
and push to that value ‘n’ ( which is 4).
a question for you.
what is the value of countup(4-1)
?