Rewrite Map and Filter as Reducers
Two of the most useful operators when working with collections are
.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
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.