Underscore.js Function Methods

About This Index
This page is the Underscore.js Functions index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.
Learn collections and arrays first on /underscore-js/collection and /underscore-js/array. Use this page when you need a function helper such as _.bind(), _.throttle(), or _.debounce().
Start with _.bind(), then _.throttle(), _.debounce(), and _.once()—then browse the rest by category.
How to Call a Function Method
Pass a function in; Underscore returns a new wrapper with the behavior you asked for:
function greet(greeting, punctuation) {
return greeting + " " + this.name + punctuation;
}
const sayHi = _.bind(greet, { name: "moe" }, "hi");
sayHi("!"); // "hi moe!"
const add = function (a, b) { return a + b; };
const add5 = _.partial(add, 5);
add5(10); // 15
const onScroll = _.throttle(function () { /* ... */ }, 100);
const onType = _.debounce(function () { /* ... */ }, 300);
const init = _.once(function () { console.log("ready"); }); Underscore.js Function Methods Table
All function method guides in this Underscore.js tutorial series (15 tutorials).
Getting Started
4 methodsBind this, partially apply arguments, and memoize results.
| Method | Description | Tutorial |
|---|---|---|
_.bind() | Creates a function bound to an object, optionally with pre-filled arguments. | Try it |
_.bindAll() | Binds named methods of an object so they can be used as callbacks safely. | Try it |
_.partial() | Partially applies arguments to a function without changing its this. | Try it |
_.memoize() | Caches computed results of a function keyed by its arguments. | Try it |
Timing & Rate Limit
4 methodsDelay, defer, throttle, and debounce function calls.
| Method | Description | Tutorial |
|---|---|---|
_.delay() | Invokes a function after a wait in milliseconds, with optional arguments. | Try it |
_.defer() | Defers a function until the current call stack has cleared. | Try it |
_.throttle() | Creates a version that runs at most once per wait window. | Try it |
_.debounce() | Creates a version that waits until calls stop for wait ms before running. | Try it |
Call Control
3 methodsLimit how many times a function may run — once, after, before.
| Method | Description | Tutorial |
|---|---|---|
_.once() | Creates a version that can only be called once; later calls return the first result. | Try it |
_.after() | Creates a version that only runs after being called count times. | Try it |
_.before() | Creates a version that can be called up to count-1 times, then returns the last result. | Try it |
Wrap & Compose
4 methodsWrap, negate, compose, and collect rest arguments.
| Method | Description | Tutorial |
|---|---|---|
_.wrap() | Wraps a function inside another, passing the original as the first argument. | Try it |
_.negate() | Returns a new predicate that is the logical opposite of the original. | Try it |
_.compose() | Returns the composition of functions — rightmost runs first. | Try it |
_.restArguments() | Creates a version that receives trailing arguments as an array (like rest params). | Try it |
Frequently Asked Questions
Start with _.bind()
Open the binding guide—syntax, examples, and FAQs.
12 people found this page helpful
