From imperative to functional JavaScript
Diogo Spínola
8169

Thank you for your article.

I’m (slowly) rewriting the code base for one of my Cordova apps with a functional approach; I come across situations where map, filter, and reduce won’t do the trick quite often. I’ve used for each in these situations as the code is much more readable than a recursive function.

What, in your view, are the drawbacks with foreach? What makes a recursive be more functional in its approach? (It looks quite imperative in my eyes?)