Ramda.js R.values() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Object

Definition

Ramda’s R.values() answers a data question: what own enumerable property values does this object hold? You pass an object. You get an array of values. Names do not appear. Prototype methods do not appear. A property set to undefined still appears.

The official sample is the whole idea. R.values({a: 1, b: 2, c: 3}) is [1, 2, 3]. Native JavaScript is Object.values. That throws on null. values returns [] instead, because it walks R.keys first. Need inherited values too? That is the next helper, R.valuesIn. Need the names? That is R.keys. Need both glued together? That is R.toPairs. Previous Object helper is R.unwind.

Syntax

Call R.values. Start with this line.

Ramda
R.values(obj)
CallWhat it does
R.values(obj)Primary signature.
R.values(...)Call the object helper.

Prefer import { values } from "ramda" when you want a named import.

Library declarations
Ramda
R.values(obj)

Parameters

ParameterDescription
objRequired. Object. The record to inspect. Arrays work: index names are skipped and the items come back as the list. null, undefined, and other primitives yiel...

Return Value

Return ValueDescription
Array of valuesOwn enumerable property values. The docs note that order is not guaranteed across JS platforms. The source object is not mutated.

Ramda Examples

📚 Getting Started

The official value list, then the same object compared with keys and toPairs.

Example 1 — Official Object Values

Own enumerable values come back as an array.

Ramda
R.values({ a: 1, b: 2, c: 3 });
//=> [1, 2, 3]
Try It Yourself

How It Works

Only the data is listed. The names stay on the object. That is the docs sample from ramdajs.com. The docs also note that order is not guaranteed across every JS platform.

Example 2 — vs R.keys and R.toPairs

keys lists names. values lists data. toPairs lists both as pairs.

Ramda
const obj = { a: 1, b: 2, c: 3 };
R.keys(obj);
//=> ['a', 'b', 'c']
R.values(obj);
//=> [1, 2, 3]
R.toPairs(obj);
//=> [['a', 1], ['b', 2], ['c', 3]]
Try It Yourself

How It Works

All three walk own enumerable properties. Pick values when you only need the numbers. Pick keys when you only need the names. Pick R.toPairs when a later map needs both.

📈 Practical Patterns

Prototype values, array items, a null-safe empty list, then a field sum in a pipe.

Example 3 — vs R.valuesIn

values lists own data. valuesIn also includes enumerable values on the prototype.

Ramda
const F = function () { this.x = 'X'; };
F.prototype.y = 'Y';
const f = new F();
R.values(f);
//=> ['X']
R.valuesIn(f);
//=> ['X', 'Y']
Try It Yourself

How It Works

x is assigned on the instance. y lives on F.prototype and is enumerable, so valuesIn sees it. Next Object helper is valuesIn. JSON field lists almost always want values, not valuesIn.

Example 4 — Arrays, Empty Object, and null

Array items come back as the list. An empty object is []. null is [] instead of a throw.

Ramda
R.values(['a', 'b']);
//=> ['a', 'b']
R.values({});
//=> []
R.values(null);
//=> []
Try It Yourself

How It Works

Arrays are objects whose own keys are index strings, so values lists the items. Native Object.values(null) throws. values returns [] because keys already returned [].

Example 5 — Sum with pipe

Add own numeric fields, or map values over a list of objects.

Ramda
const totalOwn = R.pipe(R.values, R.sum);
totalOwn({ a: 1, b: 2, c: 3 });
//=> 6

R.map(R.values, [{ a: 1 }, { b: 2, c: 3 }]);
//=> [[1], [2, 3]]
Try It Yourself

How It Works

Arity 1 makes values a clean first step in a pipe and a fine mapper. R.sum then adds the numbers. Previous Object helper R.unwind is a different job: it explodes one array field, it does not list every field.

Browser Support

R.values() is ordinary JavaScript once Ramda is loaded. Logos use the shared browser-image-sprite.png sprite from this project.

✓ Ramda 0.1.0+ · Any JS runtime

Ramda.js R.values()

Load Ramda 0.1.0 or later via CDN or npm, then call R.values with an object. No extra browser API is required.

100% With Ramda 0.1.0+
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
R.values() Universal

Bottom line: Safe in any project that includes Ramda 0.1.0 or later. Use a CDN build such as ramda.min.js in the browser or install ramda from npm for Node. These labs use [email protected].

Frequently Asked Questions

R.values(obj) returns an array of the object's own enumerable property values. Inherited prototype values do not appear. Added in v0.1.0.
R.values({a:1, b:2, c:3}) is [1, 2, 3].
keys lists names. values lists data. toPairs lists both as pairs. valuesIn also includes enumerable prototype values.
Native Object.values throws on null. R.values(null) returns [] because it walks R.keys first.
Yes. Own properties count even when the value is undefined. Existence is not truthiness. JSON.stringify turns that hole into null.
No. R.values is a stable Ramda object helper from v0.1.0. It is not deprecated, experimental, or non-standard.

Continue to R.valuesIn()

Learn how to list own and enumerable prototype property values using Ramda R.valuesIn().

R.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.

6 people found this page helpful