O'Reilly logo

Learning Underscore.js by Alex Pop

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functions

Underscore has a series of functions that specifically target objects of the type Function: it has functions that target other functions. This subsection touches on some of the functional programming concepts that will be explored in detail in Chapter 4, Programming Paradigms with Underscore.js.

Functional composition with bind, bindAll, and partial

The first function is _.bind(function, object, *arguments) that returns a new function wrapper for the original function parameter. The wrapper function has the this value set to the object parameter and its arguments will be prefilled in order with the values from the *arguments parameters. The returned function is also known as bound function and is an example of functional composition in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required