Underscore.js _.pluck() Method

Beginner
5 min read
Updated: Nov 2026
4 examples
Collection

Definition

A convenient version of the most common _.map case: pull one property from every item and return those values as a list (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 _.pluck. Start with this line.

Underscore
_.pluck(list, propertyName)
CallWhat it does
_.pluck(list, propertyName)Primary signature.
_.pluck(...)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
_.pluck(list, propertyName)

Parameters

ParameterDescription
listRequired. Array, array-like, or plain object
propertyNameRequired. String name of the field to read

Return Value

Return ValueDescription
*New array of extracted values

Underscore.js Examples

Example 1 — Pluck Names

Extract one string field from every object — the classic docs example.

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

_.pluck(stooges, "name");
// → ["moe", "larry", "curly"]
Try It Yourself

How It Works

  1. List of objects. Each stooge has a name field.
  2. Read the field. _.pluck pulls "name" from every item.
  3. New array. You get the names in source order.
  4. Source safe. stooges is left unchanged.

Example 2 — Pluck Ages

Same list, different field — useful before summing or ranking.

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

_.pluck(stooges, "age");
// → [40, 50, 60]
Try It Yourself

How It Works

  1. Change the key. Pass "age" instead of "name".
  2. Numeric values. Result is [40, 50, 60].
  3. Next step. Feed that array to sum, max, or chart code.
  4. Still one pass. Pluck stays a simple field extract.

Example 3 — Missing Fields Stay Undefined

Items without the property still occupy a slot — nothing is dropped.

Underscore
var users = [
  { name: "Ada", email: "[email protected]" },
  { name: "Linus" },
  { name: "Grace", email: "[email protected]" }
];

_.pluck(users, "email");
// → ["[email protected]", undefined, "[email protected]"]
Try It Yourself

How It Works

  1. Three users. Only two have email.
  2. Middle slot. Linus yields undefined.
  3. Length matches. Result length equals list length.
  4. Filter later. Compact with _.compact if you want to drop holes.

Example 4 — Pluck Object Values

On a plain object, Underscore reads the field from each value.

Underscore
var byId = {
  a: { id: 1, title: "Clean Code" },
  b: { id: 2, title: "Refactoring" }
};

_.pluck(byId, "id");
// → [1, 2]
Try It Yourself

How It Works

  1. Object input. Keys a and b hold nested objects.
  2. Read values. Pluck looks at each value’s id.
  3. Flat array. Keys are not part of the result.
  4. Same idea. Still “one field from each item.”

Browser & Runtime Support

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

_.pluck()

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
_.pluck 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]). Native alternative: list.map(item => item.prop) or Underscore’s own _.map(list, _.property(prop)).

Frequently Asked Questions

_.pluck(list, propertyName) reads propertyName from every item and returns those values as a new array — the most common use of map, in one short call.
That slot becomes undefined. _.pluck does not skip items — you always get one entry per element, in order.
_.pluck only extracts one field. _.map runs any transform. Under the hood, _.pluck(list, name) is like _.map(list, _.property(name)).
Yes. It reads the property from each value and returns a flat array. Object keys are not kept in the result.
No. It returns a new array of extracted values; the source is unchanged.
Use _.invoke when you need to call a method on each item. Use _.pluck when you only need to read a property.

Next: _.max()

Find the largest value in a collection, with optional iteratee ranking.

_.max() →

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