Reduces a collection to a single accumulated value by running each element through an iteratee. If no accumulator is given, the first element is used as the initial value. Part of Lodash 4.x Collection (since 0.1.0).
Pass the required arguments shown below. Lodash Collection helpers usually return a new value — check whether the source is mutated.
Syntax
Call _.reduce on a collection. Start with this line.
Habit. Always pass a seed when empty input is possible.
Compatibility
Browser & Runtime Support
_.reduce is a Lodash 4.x Collection helper (since 0.1.0). It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 0.1.0+
_.reduce()
Available in [email protected] full builds and the lodash/reduce modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.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
_.reduceLodash 4.x+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import reduce from "lodash/reduce" for smaller builds. Not a native browser API — load Lodash first. For arrays-only, native Array.prototype.reduce is also fine.
Frequently Asked Questions
_.reduce(collection, iteratee, [accumulator]) folds every element into one accumulated value. Each step receives the previous result plus the next value.
For arrays, Lodash uses the first element as the seed and starts iterating from the second. Prefer an explicit seed — especially when the collection may be empty.
It does not change the source collection. Your iteratee may mutate the accumulator object if you reuse and return the same reference.
_.reduce walks left-to-right; _.reduceRight walks right-to-left. Order matters for non-commutative operations like subtraction or string building.
Yes. Lodash iterates enumerable values and passes the key as the third iteratee argument.
Use import reduce from "lodash/reduce" or require("lodash/reduce") for tree-shaking. Full build: import _ from "lodash" then _.reduce.