Underscore.js Function Methods

Beginner
6 min read
Updated: Nov 2026
15 method guides
Method index

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().

Beginner path.

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:

Underscore
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 methods

Bind this, partially apply arguments, and memoize results.

MethodDescriptionTutorial
_.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 methods

Delay, defer, throttle, and debounce function calls.

MethodDescriptionTutorial
_.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 methods

Limit how many times a function may run — once, after, before.

MethodDescriptionTutorial
_.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 methods

Wrap, negate, compose, and collect rest arguments.

MethodDescriptionTutorial
_.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

They create new functions: binding this (_.bind / _.bindAll), partial application (_.partial), caching (_.memoize), timing (_.delay / _.defer), rate limiting (_.throttle / _.debounce), call limits (_.once / _.after / _.before), and composition (_.compose / _.wrap / _.negate).
No. They return a new function. The original stays untouched—assign or pass the returned wrapper where you need the new behavior.
Use _.bind when this must stay fixed (you may also pre-fill arguments). Use _.partial when you only want some arguments pre-filled and this should stay dynamic.
_.throttle runs at most once per wait window while events keep firing. _.debounce waits until calls pause for wait ms, then runs once—ideal for search-as-you-type.
Start with _.bind(), then _.throttle(), _.debounce(), and _.once() from the table below.

Start with _.bind()

Open the binding guide—syntax, examples, and FAQs.

_.bind() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

12 people found this page helpful