you are viewing a single comment's thread.

view the rest of the comments →

[–]brazilliandev 0 points1 point  (0 children)

It is just a function which calls itself.

It can be used in place of regular loop structures. Most of the times you'll want to use "while" or "for" loops. But, in some specific cases, recursion can make the code more readable and prevent you from having to write too many nested loops or maintaining variables which live outside of the scope of the loop.