Hacker News new | ask | show | jobs
by yjhoney 2534 days ago
Ultimately, everyone should use higher order functions. In your case (as other commenters have said), map or forEach should have been used.

I don't really want to make a statement that recursion makes debugging easier because I don't code like that at work. I use utility functions (map, reduce, filter, etc.)