Rewrite Map and Filter as Reducers

InstructorPaul Frend

Share this video with your friends

Send Tweet

Two of the most useful operators when working with collections are .map() and .filter(). We want our transducers to be able to combine these operations in a single pass when iterating through our collections. To do this we need to find a commonality between the two, so we can treat them the same. To achieve this common ground, we'll create map() and filter() functions which use the built in .reduce() function under the hood instead, and we’ll start to combine the concepts of transforming and reducing.

George Katsanos
~ 7 years ago

What is the webstorm plugin you're using for inline as-you-type execution of your JS?

Paul Frendinstructor
~ 7 years ago

It's called quokka, check it out https://quokkajs.com/