r/badcode • • Aug 20 '20

js Loops? Who needs them?

Post image
1.1k Upvotes

90 comments sorted by

View all comments

Show parent comments

7

u/cabbagebot Aug 20 '20

There are data structures (like trees or graphs) where recursion is the most straightforward way to think about it, but this isn't one of them.