Book Image

Lo-Dash Essentials

By : Adam Boduch
Book Image

Lo-Dash Essentials

By: Adam Boduch

Overview of this book

Table of Contents (15 chapters)
Lo-Dash Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


This chapter introduced the concept of wrapped values and the function call chains applied to them. This versatile programming model, fundamental to Lo-Dash, assists in building complex chunks of functionality using compact and legible code. Chained calls aren't unique to Lo-Dash—they're popular in many other libraries, perhaps mostly so in jQuery.

Applications are faced with the tough job of filtering data—lots of data and lots of hard constraints. Instead of creating messy code with lots of temporary variables, we addressed several ways to construct complex filters using chains. After that, we looked at testing truth conditions using chains. These are like filters, except they don't return collection results but only truth statements expressed as Boolean values. We also looked at how to count items after they've moved through a function call chain.

Another fundamental practice we learned was transforming collections into alternative, more usable representations that better fit a...