Fancy forEach with functional programming in JavaScript

Chris Coyier Chris Coyier on

I enjoyed this blog post from Blake Watson about a simple requirement and then going down the rabbit hole of functional programming to solve it in increasingly reusable, if mind-bending ways. By the end:

Creating a function that returns a function that returns a function can get a little trippy to think about. But what we’ve done is make our work reusable and flexible.

Blake admits he didn’t actually use the fully functional abstracted functional version. I vibe with that. Take it as far as you can without sacrificing clarity.

It's time to take your JavaScript to the next level

Frontend Masters logo

Frontend Masters is the best place on the web to really learn JavaScript. We have a complete learning path from the biggest and best teachers in JavaScript to help you make the most out of the web's biggest language.

7-Day Free Trial

Leave a Reply

Your email address will not be published. Required fields are marked *

Did you know?

Frontend Masters Donates to open source projects. $363,806 contributed to date.