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


Hopefully after reading this chapter, your appreciation for functions in JavaScript went up a little. Lo-Dash just makes functional programming in the frontend that much better. Functions in JavaScript are flexible by default, changing the execution context for example. This chapter showed you how some Lo-Dash functions make working with function contexts much easier by removing much of the boiler-plate code that would otherwise be needed. Partials are fundamental to functional programming, but it's one of those tasks that's anything but easy in JavaScript. Lo-Dash makes it easy to create partials and to decorate functions by wrapping them with additional logic.

We looked at functions that help constrain when a function should run. For example, should a function be allowed to run only once? Should the return values be cached? Timing the execution of functions is a complex topic, especially when you consider the DOM and how it integrates with the JavaScript call stack. Lo-Dash has...