Part 2 takes the objects defined in the first part and brings them to life. Functions kick the gears into motion on any JavaScript application. Unfortunately, most JavaScript developers don’t take full advantage of the power of JavaScript functions. By taking advantage of the fact that functions are also objects in the system, you’ll begin to appreciate the joy of JavaScript. Part 2 also introduces new syntax that will change how you structure your JavaScript code: the pipeline and bind operators.
Chapter 4 starts by teaching you how to use JavaScript in a functional manner. You’ll learn to decompose problems into small tasks, each represented by a function, and to compose them back together. To enable this capability, higher-order functions allow you to pass, return, and dynamically call functions. You’ll learn how to use partially applied (curried) functions to prebake or configure the functions you’ll assemble into compositional chains. Also in store in chapter 4 is a preview of JavaScript’s proposed pipeline operator, which will bring the power of functional languages like Elixir and F# to JavaScript.