I prefer recursion to loops since loops bundle everything together in one environment; variables left over from previous iterations are still in scope, which is confusing and may cause problems, e.g. using a variable before it&#x27;s been updated for this iteration, or after it&#x27;s been updated for the next iteration, etc.<p>Recursion is just function calls. The only things which are in scope are those required by this iteration, accepted as arguments. The only thing I need to produce is a return value. This is a small, well-defined interface, as opposed to the self-interfering spaghetti code of a loop.<p>By accepting values as arguments and calling functions with different values, the problem of when and what to assign variables goes away; the language does it automatically by binding arguments.<p>Also, recursion (like function calls in general) allows thinking in terms of values, which are timeless and explicit in the code, rather than state, which is implicit and varies during execution.<p>Semi-related: <a href="http:&#x2F;&#x2F;chriswarbo.net&#x2F;blog&#x2F;2012-10-02-looping_in_javascript.html" rel="nofollow">http:&#x2F;&#x2F;chriswarbo.net&#x2F;blog&#x2F;2012-10-02-looping_in_javascript....</a>