Creates a wrapper of function that does nothing at first. From the count-th call onwards, it starts actually calling function (official Underscore docs). Useful for grouping asynchronous responses. 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 _.after. Start with this line.
Underscore
_.after(count, function)
Call
What it does
_.after(count, function)
Primary signature.
_.after(...)
Call with the arguments your case needs.
Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.
Choose deliberately based on whether repeats should fire.
Compatibility
Browser & Runtime Support
_.after 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
_.after()
Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.
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
_.afterUnderscore 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]).
Frequently Asked Questions
_.after(count, function) returns a wrapper that does nothing at first. From the count-th call onward, it starts calling the original function. Useful for grouping async responses.
No. From the count-th call onward, every call runs the function. In the official notes example it looks like once because each note saves exactly once (exactly count calls).
_.after starts running at call count and keeps going. _.before runs for the first count-1 calls, then freezes on the last return value.
_.once(fn) allows a single run. _.after delays the first run until a threshold, then allows every later call.
The first call already runs fn — count is 1, so the count-th call is the first one.
Fire n async tasks and pass the same wrapper as each success callback. When the n-th response arrives, your finish function runs.