The right-associative version of _.reduce — same fold idea, but it walks the list from the last element to the first (official Underscore docs). Stable Collection helper — not deprecated.
Pass the required arguments shown below. Underscore collection helpers usually return a new value — check whether the source is mutated.
Syntax
Call _.reduceRight. Start with this line.
Underscore
_.reduceRight(list, iteratee, [memo])
Call
What it does
_.reduceRight(list, iteratee, [memo])
Primary signature.
_.reduceRight(...)
Call with the arguments your case needs.
Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.
_.reduceRight 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
_.reduceRight()
Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded. Alias foldr included.
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
_.reduceRightUnderscore 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: Array.prototype.reduceRight on real arrays.
Frequently Asked Questions
_.reduceRight(list, iteratee, [memo], [context]) is the right-associative version of _.reduce. It folds a collection into one value, processing from the last element to the first.
No. foldr is an alias of reduceRight — same function.
Both fold into one value. _.reduce goes left-to-right; _.reduceRight goes right-to-left. Order matters for concat, subtraction, and similar ops.
The last element becomes the starting memo, and iteration continues toward the first element.
When combination order matters and you need to start from the end — for example right-to-left concat. Prefer _.reduce for ordinary left-to-right totals.
The official docs note foldr is less useful in JavaScript than in languages with lazy evaluation. Reach for it when direction truly matters.