Function binding
Function binding is the creation of a function with a predetermined this value and, optionally, preset arguments.
Functional Programming in JavaScript
The technique of associating a function with a specific this value or preset arguments so it can be invoked in a controlled context.
- How it is used
- Uses preset arguments to turn general functions into modular, reusable operations.
- How deep it goes
- Defines binding, contrasts it with currying and partial application, and demonstrates configured callbacks without detailing binding internals.
- Examples
- Demonstrates a bound logger, partially configured string methods, and scheduled callbacks.
- What you can do after
- Apply it via Lodash _.bind or JavaScript Function.prototype.bind to create configured functions.
Read how Functional Programming in JavaScript explains function binding →
The Joy of JavaScript
The JavaScript method that creates a new function with a bound this value and optional leading arguments.
- How it is used
- Uses bind to repair a method's this reference while composing functions around object state.
- How deep it goes
- Explains context correction, partial argument application, and maintainability tradeoffs before shifting to explicit parameters.
- Examples
- Uses assemble.bind(this, keys) inside calculateHash and contrasts it with assemble(keys, obj).
- What you can do after
- Apply it via JavaScript's bind method to preserve object context and prefill keys, while recognizing its maintainability cost.
Related concepts
- thisconfigures · In JavaScript, the this value is determined by a function’s call context or, for an arrow function, inherited lexically.
- arrow functioncontrasts with · An arrow function is a JavaScript function expression written with arrow syntax that uses lexical binding for this and has no own arguments object.
- functionproduces · A function is a defined operation that maps inputs to outputs and, when implemented as a callable program unit, may also produce effects.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

