when is it best to use a recursive function vs a for loop
You're viewing a single thread.
When doing functional programming, you can't really do loops (because of referential transparency, you can't update iterators or indices). However, recursion still works.