DEV Community

Discussion on: Map, Filter, Reduce vs For Loops (syntax)

Collapse
 
johnboy5358 profile image
John

Hi Joel,

I'm one of those noobs, but trying my very best not to be. I am trying to teach myself functional programming in JavaScript and I have come upon the subject of transducers. This code looks very similar; can you confirm that this code is, or is closely related to the concept of transducers.

Thanks

Thread Thread
 
joelnet profile image
JavaScript Joel

Transducers are the next evolution. You would start with a list, and learn map, filter, reduce. Once you start applying multiple map/filter/reduces to a single list, you realize you are enumerating the list multiple times, which will slow down your application.

Transducers are a way to apply those multiple map/filter/reduces while enumerating the list one time.