Improving performance

Just because Lo-Dash is designed from the ground up for optimal performance, it doesn't mean there are no basic modifications we can make to our Lo-Dash code to improve performance. In fact, we can sometimes borrow some Lo-Dash design principles and apply them directly to our code that utilizes Lo-Dash.

Changing the operation order

Using a Lo-Dash wrapper around a value, such as an array, lets us chain together many operations on that value. As we saw in Chapter 6, Application Building Blocks, a wrapper has many advantages over stitching together, piecemeal, several statements that call Lo-Dash functions. For example, the end result is often more concise and readable code. The different orders in which we call these operations ...

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.