A functor is a data structure that can be mapped over using a custom mapping interface. In order words, a functor asks as a wrapper around data which can expose that internal data with that mapping interface. The newly transformed data after mapping gets placed back into a new functor.
This process allows for some interesting composition, specifically function composition since we can chain functions to one another.
Functors are a central topic in functional programming. If you don’t know much about functional programming, I made two other videos that touch on topics within the paradigm.
#javascript #programming #functors