Chapter 5. Assembling Chains

So far, the examples we've looked at in this book used Lo-Dash functions independently of one another. That's not to say they're not working together; it's just that they could be cleaner, or more condensed. We would call the function to compute a value, store that value, call another function to compute a new value using the stored value as an argument, and repeat the same process. This is exhausting but can be easily remedied.

The idea is to streamline this functionality into a chain of calls. This approach follows the concept of applicative programming, whereby we have a starting collection and at each stage in the chain, that collection is transformed. It's like an assembly line where the resulting product is a ...

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.