Lodash _.values() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Object

Definition

Creates an array of the own enumerable string-keyed property values of object. Part of Lodash 4.x Object (since 0.1.0).

Pass the object and path or keys shown below. Check whether the helper mutates or returns a new object.

Syntax

Call _.values. Start with this line.

Lodash
_.values(object)
CallWhat it does
_.values(object)Primary signature.

Prefer import values from "lodash/values" when you want a smaller bundle.

Library declarations
Lodash
_.values(object)

Parameters

ParameterDescription
objectRequired. Source whose own enumerable values are collected

Return Value

Return ValueDescription
*New array of values (order follows enumeration)

Lodash Examples

Example 1 — Official Constructor Instance

Own values only — prototype properties are skipped.

Lodash
function Foo() {
  this.a = 1;
  this.b = 2;
}
Foo.prototype.c = 3;

_.values(new Foo());
// → [1, 2]
Try It Yourself

How It Works

  1. Own. a and b live on the instance.
  2. Inherited. c lives on Foo.prototype.
  3. Collect. values pushes only own enumerable values.
  4. Docs. Matches the official Lodash example.

Example 2 — Official String Coercion

Strings are treated as object-like index → character maps.

Lodash
_.values("hi");
// → ["h", "i"]
Try It Yourself

How It Works

  1. Indexes. "hi" has keys "0" and "1".
  2. Chars. Values are the characters at those indexes.
  3. Result. You get ["h", "i"].
  4. Docs. Same as the official string example.

Example 3 — Plain Object Values

Everyday case: drop keys and keep the value list.

Lodash
_.values({ a: 1, b: 2, c: 3 });
// → [1, 2, 3]

_.keys({ a: 1, b: 2, c: 3 });
// → ["a", "b", "c"]
Try It Yourself

How It Works

  1. values. Collects 1, 2, 3.
  2. keys. Collects the matching names.
  3. Pair. Same property set — different projections.
  4. Use. Pick values when keys are not needed.

Example 4 — Own vs valuesIn

Inherited enumerable properties need valuesIn.

Lodash
function Proto() {}
Proto.prototype.shared = 9;

var obj = Object.create(Proto.prototype);
obj.own = 1;

_.values(obj);
// → [1]

_.valuesIn(obj);
// → [1, 9]
Try It Yourself

How It Works

  1. values. Sees only own on the instance.
  2. Prototype. shared lives on the prototype.
  3. valuesIn. Walks the chain and includes 9.
  4. Pick. Prefer values for plain data objects.

Example 5 — Sum Numeric Values

Turn an object into numbers, then aggregate with array helpers.

Lodash
var sales = { mon: 10, tue: 20, wed: 5 };

_.values(sales);
// → [10, 20, 5]

_.sum(_.values(sales));
// → 35
Try It Yourself

How It Works

  1. Extract. values drops the day keys.
  2. Array. You now have a normal number list.
  3. Sum. _.sum totals the list.
  4. Pattern. Same idea works with _.mean, _.max, and friends.

Browser & Runtime Support

_.values is a Lodash Object helper (since 0.1.0). It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Closest native cousin is Object.values() (ES2017); Lodash stays useful for null-safety and consistent Object API with _.keys / _.valuesIn.

✓ Stable · Lodash 4.x

_.values()

Available in [email protected] full builds and the lodash/values modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.

100% With Lodash 4.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
_.values Lodash 0.1+

Bottom line: Safe for production once Lodash is loaded. Prefer import values from "lodash/values" for smaller builds. Ideal before summing, filtering, or mapping object values as arrays.

Frequently Asked Questions

_.values(object) returns an array of the object's own enumerable string-keyed property values. Keys are dropped — only values remain.
No. It returns a new array. The source object is unchanged.
No. Only own enumerable properties. Use _.valuesIn() when you also need inherited enumerable values.
For plain objects they match in modern JS. Lodash is null-safe: _.values(null) and _.values(undefined) return [] instead of throwing.
_.keys() returns names; _.values() returns values for the same own enumerable string keys. Lengths match for normal objects.
Use import values from "lodash/values" or require("lodash/values"). Full build: import _ from "lodash" then _.values.

Next: _.valuesIn()

Collect own and inherited enumerable property values.

_.valuesIn() 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.

8 people found this page helpful