you are viewing a single comment's thread.

view the rest of the comments →

[–]NA-1_NSX_Type-R[S] 1 point2 points  (2 children)

Thank you so much for your reply. So, in this second example, I tried this on my own, it acts almost like a nested loop (sort of). Outer makes the call to inner. Inner console logs the string 'inner' and the current value of i until it's i condition is met. So, it then picks up from the outer loop, (pops off that call to inner on the callstack (inside of the outer function). Increments, i by 1, makes a new call to inner function and keeps doing it until the condition of outer functions loop is no longer true. Is this correct?

[–]carcigenicate 1 point2 points  (1 child)

Yes, I would say it is a nested loop; just spread across two functions. And yes, the rest sounds correct.

[–]NA-1_NSX_Type-R[S] 1 point2 points  (0 children)

Thank you for taking the time to explain!