Composing and currying functions

The last section of this chapter is about assembling functions that realize larger behavior out of smaller functions. There are two ways to assemble such functions. The first is to use the appropriately named compose() function, which performs a nested invocation of the provided functions, or where order is important, we can use the flow() function to return values together. Currying lets you adapt your function to be called successively in different contexts. Each of these Lo-Dash tools lets you take the existing functionality in your application and build on it in interesting ways.

Composing functions

The compose() function builds a new function out of the provided functions. When we call this new function, a nested ...

Get Lo-Dash Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.