_.values() walks a plain object and returns an array containing each own enumerable property value—without the keys. It is Lodash’s version of Object.values() and the value-side counterpart to _.keys().
💡
Values as arrays unlock array utilities
Once you have a values array, you can sum, filter, map, or pass it into charts—without manually looping with for...in.
Use it when totaling sales by product, averaging ages from a lookup object, feeding chart libraries, or piping object data through Lodash chains where you only care about the values, not the keys.
Foundation
📝 Syntax
The signature takes one argument—the object whose values you want:
javascript
_.values(object)
Syntax Rules
object — any object (or object-like value Lodash accepts).
Return value — array of property values in enumeration order.
Included values — from own enumerable string-keyed properties only.
Excluded — symbol keys, non-enumerable props, and inherited prototype values.
Null-safe — returns [] for null or undefined (unlike Object.values()).
Lodash collects own enumerable string-keyed property names from the object.
Input
2
Read values
Each key is used to read the current property value from the object.
Collect
3
Return array
A new array of values is returned; the original object is untouched.
Output
=
📊
Ready to aggregate
Pass the values array to _.sum, _.mean, _.max, or any array utility.
Important
📝 Notes
_.values() does not mutate the source object—it returns a new array.
Only own enumerable string-keyed property values are included.
Nested object values are not flattened—each nested object is one array element.
Value order matches _.keys() enumeration order for the same object.
For inherited enumerable values, use _.valuesIn().
For property names instead of values, use _.keys() or _.toPairs() when you need both.
Wrap Up
Conclusion
_.values() turns object property values into a plain array, making summing, averaging, filtering, and charting straightforward. Pair it with _.keys() when you need names and values separately, or _.toPairs() when you need both together.
For plain objects in modern JavaScript, Object.values() is equivalent—choose Lodash when you want null-safe behavior or consistency in a Lodash pipeline. Next in the series: _.valuesIn() for inherited property values.
Combine with _.sum, _.mean, or _.max for numeric objects
Prefer _.values over Object.values when input may be null
Pair with _.keys when you need parallel key/value arrays
Use _.toPairs when you need both key and value in each iteration
❌ Don’t
Expect _.values to flatten nested objects recursively
Assume symbol keys or non-enumerable props are included
Use _.values when you need inherited prototype values (use _.valuesIn)
Sum values without confirming they are all numbers
Confuse _.values with _.mapValues—the latter transforms and returns a new object
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about _.values()
Use these when extracting property values into arrays.
5
Core concepts
🔗01
Object → values
value[]
Core
📦02
Non-mutating
New array.
Important
🗃️03
Own values
Enumerable strings.
Scope
🔀04
Aggregate
sum, mean, max.
Pattern
🛠️05
Null-safe
[] for null.
Compare
❓ Frequently Asked Questions
_.values() collects the values of an object's own enumerable string-keyed properties into a new array. Keys are not included—only the property values, in enumeration order.
No. _.values() reads the object and returns a new array. The source object is unchanged.
No. Only own enumerable properties on the object itself are included. Use _.valuesIn() when you also need inherited enumerable values.
For plain objects they return the same values in modern JavaScript. _.values() is null-safe—it returns [] for null or undefined instead of throwing a TypeError like Object.values().
_.keys() returns property names; _.values() returns property values. Both cover the same own enumerable string keys, so _.keys(obj).length === _.values(obj).length.
Yes. Pass the array to _.sum(), _.mean(), or other array utilities—for example _.sum(_.values(salesData)) totals all numeric values in an object.
Did you know?
_.values() is the value-side twin of _.keys()—both cover the same own enumerable properties, but one returns names and the other returns values. Unlike Object.values(), Lodash returns an empty array for null or undefined, which makes it safer in pipelines where the input might be missing.