The functional programmer's toolkit
If you've looked closely at the few examples presented so far, you'll notice a few methods being used that you may not be familiar with. They are the
reduce() functions, and they are crucial to every functional program of any language. They enable you to remove loops and statements, resulting in cleaner code.
reduce() functions make up the core of the functional programmer's toolkit, a collection of pure, higher-order functions that are the workhorses of the functional method. In fact, they're the epitome of what a pure function and what a higher-order function should be like; they take a function as input and return an output with zero side effects.
While they're ...