Returns the maximum value in list. If an iteratee is provided, it ranks each value by that criterion and returns the winning original element (official Underscore docs).
Pass the required arguments shown below. Underscore collection helpers usually return a new value — check whether the source is mutated.
Syntax
Call _.max. Start with this line.
Underscore
_.max(list, [iteratee], [context])
Call
What it does
_.max(list, [iteratee], [context])
Primary signature.
_.max(...)
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
_.max(list, [iteratee], [context])
Parameters
Parameter
Description
list
Required. Collection to scan
iteratee
Optional. Function or property name that returns the ranking number
context
Optional. this for a function iteratee
Return Value
Return Value
Description
*
Winning element (or -Infinity if empty)
Underscore.js Examples
Example 1 — Official: Max by Iteratee
Rank objects with a function; return the winning original object.
Shared API. Both take a list and optional iteratee.
max. Keeps the highest score (40).
min. Keeps the lowest score (10).
Pick by intent. Largest → max; smallest → min.
Compatibility
Browser & Runtime Support
_.max 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
_.max()
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
_.maxUnderscore 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
_.max(list, [iteratee], [context]) returns the single largest value in the list. With an iteratee, it ranks each value by the number the iteratee returns and gives back the winning original element.
-Infinity. Guard with _.isEmpty(list) when you need a different empty result.
Yes. A string iteratee uses that property as the ranking number — e.g. _.max(stooges, 'age').
Math.max takes numeric arguments and returns a number. _.max takes a collection, supports an iteratee for objects, and returns the original winning element.
Same API — _.max picks the largest criterion, _.min the smallest.
Yes. For a plain object it compares the object’s values and returns the largest one.