Here is a shorter way of achieving it:
let result = objArray.map(a => a.foo);
OR
let result = objArray.map(({ foo }) => foo)
You can also check Array.prototype.map().
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › values
Object.values() - JavaScript - MDN Web Docs
5 days ago - The Object.values() static method returns an array of a given object's own enumerable string-keyed property values.
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-object-values-method
JavaScript Object values() Method - GeeksforGeeks
Object.values() takes the object as an argument of which the enumerable property values are to be returned and returns an array containing all the enumerable property values of the given object.
Published: July 12, 2024
10:01
JavaScript ARRAYS of OBJECTS are easy! 🍎 - YouTube
JavaScript: Create a New Array By Extracting Object Values - YouTube
02:05
JavaScript tips — Convert an object into an array of values, ...
08:07
JavaScript Object to Array using Object.values, Object.keys and ...
JavaScript Tip: Retrieving a Property from an Array of Objects
What does Object.values() return?
An array of the object's own enumerable property values, in insertion order.
codeshack.io
codeshack.io › home › references › javascript › object.values()
JavaScript Object.values() Method: Syntax, Parameters & Examples
What is the difference between Object.values() and Object.keys()?
Object.values() returns the values; Object.keys() returns the property names.
codeshack.io
codeshack.io › home › references › javascript › object.values()
JavaScript Object.values() Method: Syntax, Parameters & Examples
How do I sum the values of an object?
Use Object.values(obj).reduce((total, n) => total + n, 0).
codeshack.io
codeshack.io › home › references › javascript › object.values()
JavaScript Object.values() Method: Syntax, Parameters & Examples
Top answer 1 of 16
2663
Here is a shorter way of achieving it:
let result = objArray.map(a => a.foo);
OR
let result = objArray.map(({ foo }) => foo)
You can also check Array.prototype.map().
2 of 16
745
Yes, but it relies on an ES5 feature of JavaScript. This means it will not work in IE8 or older.
var result = objArray.map(function(a) {return a.foo;});
On ES6 compatible JS interpreters you can use an arrow function for brevity:
var result = objArray.map(a => a.foo);
Array.prototype.map documentation
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › values
Array.prototype.values() - JavaScript - MDN Web Docs
June 19, 2026 - The values() method of Array instances returns a new array iterator object that iterates the value of each item in the array.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › entries
Object.entries() - JavaScript - MDN Web Docs
4 days ago - This is the same as iterating with a for...in loop, except that a for...in loop enumerates properties in the prototype chain as well. The order of the array returned by Object.entries() is the same as that provided by a for...in loop. If you only need the property keys, use Object.keys() instead. If you only need the property values, use Object.values() instead.
Programiz
programiz.com › javascript › library › object › values
JavaScript Object.values() | Programiz
March 18, 2024 - The values() method, being a static method, is called using the Object class name. ... The values() method returns an array of strings that represents all the enumerable property values of the given object.
JavaScript Tutorial
javascripttutorial.net › home › javascript object methods › javascript object.values()
JavaScript Object.values() Method
May 8, 2024 - Object.values(obj);Code language: JavaScript (javascript) The Object.values() method accepts an object and returns its own enumerable property’s values as an array.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › keys
Object.keys() - JavaScript - MDN Web Docs
4 days ago - This is the same as iterating with a for...in loop, except that a for...in loop enumerates properties in the prototype chain as well. The order of the array returned by Object.keys() is the same as that provided by a for...in loop. If you need the property values, use Object.values() instead.
Codecademy
codecademy.com › docs › javascript › objects › .values()
JavaScript | Objects | .values() | Codecademy
August 22, 2025 - Returns an array containing the values of an object’s own enumerable properties.
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-convert-an-object-into-array-of-objects-in-javascript
How to Convert an Object into Array of Objects in JavaScript? - GeeksforGeeks
July 23, 2025 - Object.values() method extracts the property values of an object and returns them as an array, converting the original object into an array of objects.
JavaScript Tutorial
javascripttutorial.net › home › convert an object to an array in javascript
Convert an Object to an Array in JavaScript
March 29, 2020 - To convert property’s values of the person object to an array, you use the Object.values() method: