This Lesson is for PRO Members.

Subscribe today and get access to all lessons! Plus direct HD download
for offline use, member comment forums, and iTunes "podcast" RSS feed.
Level up your skills now!


Already subscribed? Sign In

Rewrite Map and Filter as Reducers

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.

Please take a moment to tell your friends:

You must be a PRO Member to view code