Number order in recursive arrays

Hello!

The simplest answer is because the count function starts filling the array when the if (n === 1) is executed, not before :stuck_out_tongue:. In other words, the first value of numbers is [1], then the n is just pushed to the array.

Look at the following topics:

If You still don’t understand I’ll try to explain it more.

1 Like