Creates a throttled version of a function that, when invoked repeatedly, only actually calls the original at most once every wait milliseconds — useful for rate-limiting fast events (official Underscore docs). Stable Function helper — not deprecated.
Pass the required arguments shown below. Underscore function helpers usually return a new function — check timing and call-count behavior carefully.
Syntax
Call _.throttle. Start with this line.
Underscore
_.throttle(fn, wait, [options])
Call
What it does
_.throttle(fn, wait, [options])
Primary signature.
_.throttle(...)
Call with the arguments your case needs.
Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.
Library declarations
Underscore
_.throttle(fn, wait, [options])
Parameters
Parameter
Description
function
Required. Function to rate-limit
wait
Required. Minimum ms between runs
options.leading
Optional. Run on first call (default true)
options.trailing
Optional. Run once after the window (default true)
Return Value
Return Value
Description
*
The value returned by _.throttle().
Underscore.js Examples
Example 1 — Basic Throttle
Rapid calls: one leading run, then a trailing run after wait.
Underscore
var count = 0;
var bump = _.throttle(function () {
count++;
}, 400);
bump(); bump(); bump(); bump();
// count becomes 1 immediately, then 2 after ~400ms
Teardown. Useful when leaving a page or removing a listener.
Compatibility
Browser & Runtime Support
_.throttle ships with Underscore.js (1.x). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.
✓ Stable · Underscore 1.x
_.throttle()
Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded. Relies on timers (setTimeout).
100%With Underscore 1.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.throttleUnderscore 1.x+
Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]). Native alternative: a timestamp + setTimeout wrapper, or requestAnimationFrame for paint-tied updates.
Frequently Asked Questions
_.throttle(function, wait, [options]) returns a version of the function that runs the original at most once every wait milliseconds — ideal for scroll, resize, and mousemove.
Throttle fires on a steady schedule while events keep coming. Debounce waits for a quiet gap, then runs once. Use throttle for continuous updates; debounce for settled actions like search.
By default both are on: run immediately (leading) and once more at the end of the wait (trailing). Pass {leading: false} or {trailing: false} to disable one edge. Do not set both to false.
Yes. The throttled function has .cancel() to clear a waiting trailing invocation.
The result of the most recent actual invocation of the original function — which may be from an earlier call within the window.