JavaScript Object.values() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Object

Definition

Object.values(obj) returns an array of the values from the object’s own enumerable string keys. Inherited values and Symbol-keyed values are skipped.

The order matches Object.keys. Use Object.entries when you need both keys and values together.

Syntax

Call Object.values() like this. Start with this line.

JavaScript
Object.values(obj)
CallWhat it does
Object.values({ a: 1, b: 2 })Returns [1, 2].
Object.values(["x", "y"])Returns ["x", "y"].
Object.values(Object.create({ a: 1 }))Returns [] when there are no own enumerable values.

Same own-enumerable-string-key rules as Object.keys. Arrays return the element list.

Library declarations
JavaScript
Object.values(obj)
JavaScript
Object.values(o: object): any[]

Parameters

ParameterDescription
objRequired. The object whose own enumerable string-keyed values you want.

Return Value

Return ValueDescription
any[]A new array of those values, in key enumeration order.

JavaScript Examples

Get Values from an Object

Print the values of a small product object.

JavaScript
var product = {
  name: "Keyboard",
  price: 49,
  inStock: true
};

console.log(Object.values(product));
console.log(Object.values(product).length);
Try It Yourself

How It Works

  1. Values array. You get the three own enumerable values in key order.
  2. Mixed types ok. Strings, numbers, and booleans can sit in the same array.
  3. Array helpers. You can use map, filter, or reduce on the result.

Pair with Object.keys

Keys and values line up by position.

JavaScript
var scores = { Ana: 90, Bo: 85, Cy: 92 };

var keys = Object.keys(scores);
var vals = Object.values(scores);

console.log(keys);
console.log(vals);
console.log(keys[1] + " => " + vals[1]);
Try It Yourself

How It Works

  1. Same order. keys[i] matches vals[i].
  2. Read a pair. Index 1 shows Bo => 85.
  3. Need pairs? Use Object.entries(scores) for [key, value] arrays.

Inherited Values Are Skipped

Only own enumerable values appear in the list.

JavaScript
var proto = { role: "guest" };
var user = Object.create(proto);
user.name = "Ada";

console.log(user.role);
console.log(Object.values(user));
Try It Yourself

How It Works

  1. Inherited read. user.role still works through the prototype.
  2. Values stay own. Object.values only returns "Ada".
  3. Same rule as keys. Inherited enumerable properties are ignored here too.

Browser & Runtime Support

Object.values() was added in ES2017 and is supported in all modern browsers and Node.js.

✓ ES2017 · Baseline

Object.values()

Available in current browsers and runtimes. Older engines may need a polyfill.

100% Modern browser support
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
Object.values Excellent

Bottom line: Safe for modern apps. For very old browsers, polyfill or map Object.keys to values manually.

Frequently Asked Questions

An array of the object’s own enumerable string-keyed values.
No. Only own enumerable string-keyed values.
No. Object.values ignores Symbol keys.
They use the same key order. keys[i] belongs with values[i].
When you need each key and value together as [key, value] pairs.

Next: hasOwnProperty()

Ask whether a key exists directly on an object.

hasOwnProperty() 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