Underscore.js _.min() Method

Beginner
5 min read
Updated: Nov 2026
4 examples
Collection

Definition

Returns the minimum value in a list. An optional iteratee ranks each value; empty lists return Infinity (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 _.min. Start with this line.

Underscore
_.min(list, [iteratee], [context])
CallWhat it does
_.min(list, [iteratee], [context])Primary signature.
_.min(...)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
_.min(list, [iteratee], [context])

Parameters

ParameterDescription
listRequired. Collection to scan
iterateeOptional. Function or property name for ranking
contextOptional. this for the iteratee

Return Value

Return ValueDescription
*Winning element, or Infinity if empty

Underscore.js Examples

Example 1 — Official: Smallest Number

Find the minimum in a list of numbers — same call as the docs.

Underscore
var numbers = [10, 5, 100, 2, 1000];
_.min(numbers);
// → 2
Try It Yourself

How It Works

  1. Scan the list. Underscore walks each number once.
  2. Keep the lowest. Whenever a smaller value appears, it becomes the winner.
  3. Result. 2 is smaller than every other entry.
  4. No change. The original array is untouched.

Example 2 — Rank Objects by Property

Pass a property name to get the original object with the lowest field.

Underscore
var stooges = [
  { name: "moe", age: 40 },
  { name: "larry", age: 50 },
  { name: "curly", age: 60 }
];

_.min(stooges, "age");
// → { name: "moe", age: 40 }
Try It Yourself

How It Works

  1. Shorthand. "age" ranks each object by that property.
  2. Compare scores. 40 < 50 < 60.
  3. Return the element. You get moe — not just the number 40.
  4. Mirror of max. _.max(stooges, "age") would return curly.

Example 3 — Rank by a Function

Use an iteratee when the score is computed, not a plain field.

Underscore
var words = ["cat", "elephant", "fox", "dolphin"];

_.min(words, function (word) {
  return word.length;
});
// → "cat"
Try It Yourself

How It Works

  1. Score each word. Lengths: 3, 8, 3, 7.
  2. Lowest score. Both "cat" and "fox" score 3.
  3. First winner wins. Underscore keeps the first element that hits the minimum.
  4. Result. "cat" — the original string, not the length.

Example 4 — Empty List Returns Infinity

Documented behavior — guard empty collections when needed.

Underscore
_.min([]);
// → Infinity

_.isEmpty([]) ? null : _.min([]);
// → null   (safe pattern)
Try It Yourself

How It Works

  1. No items. There is nothing smaller to pick.
  2. Seed value. Underscore uses Infinity as the starting minimum.
  3. Guard. Check _.isEmpty before trusting the result.
  4. Pair with max. Empty _.max returns -Infinity.

Browser & Runtime Support

_.min 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

_.min()

Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.

100% With Underscore 1.x
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
_.min Underscore 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]). For plain numbers only, Math.min.apply(null, nums) or Math.min(...nums) is a native alternative.

Frequently Asked Questions

_.min(list, [iteratee], [context]) returns the smallest value in the list. With an iteratee it ranks each item by a computed number and returns the original winning element.
Infinity. The docs recommend an isEmpty guard when that matters.
Yes. Pass a property name string or a function as the iteratee, e.g. _.min(people, 'age') returns the youngest person object.
Math.min takes separate numbers and returns a number. _.min takes a collection, supports an iteratee, and returns the original winning element.
Yes. For a plain object it compares the object's values and returns the smallest one.
No. It only reads the collection and returns one value.

Next: _.sortBy()

Return a stably sorted copy of a list ranked by an iteratee.

_.sortBy() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful