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

Answer from Jalasem on Stack Overflow
๐ŸŒ
DEV Community
dev.to โ€บ awaisalwaisy โ€บ 7-ways-to-convert-objects-into-array-in-javascript-35m4
7 ways to convert Objects into Array in JavaScript - DEV Community
February 12, 2023 - The first method to convert a JavaScript object into an array is using Object.entries(). Object.entries() is a method available on all JavaScript objects that returns an array of arrays, where each inner array consists of a key/value pair from ...
Discussions

How might I extract the property values of a JavaScript object into an array? - Stack Overflow
Depending on your specific use ... fit to solving your problem. ... Save this answer. ... Show activity on this post. ... var result = []; var keys = Object.keys(myObject); for (var i = 0, len = keys.length; i < len; i++) { result.push(myObject[keys[i]]); } ... Save this answer. ... Show activity on this post. Object.values() method is now supported. This will give you an array of values of an object. ... Refer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference... More on stackoverflow.com
๐ŸŒ stackoverflow.com
jquery - JavaScript, transform object into array - Stack Overflow
One solution (obviously) would ... the values and puts them into an array: ... I will accept such a function as the answer. However, I would be more pleased if there would be an API function (ECMAScript, jQuery, browser-specific, ...) that could do this. Is there such a thing? ... The obvious way would be to do a for-in loop, as @quixoto suggests, but just for the record, and since you are looking for a built-in way, you could pair the new ECMAScript 5 methods Object.keys and ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to convert an Object {} to an Array [] of key-value pairs in JavaScript - Stack Overflow
Finally (not part of the original ... or the value, but you don't want sparse arrays, no duplicates and no reordering without the need to convert to numeric keys (even can access very complex keys), then array (or object) is not what you need. I will recommend Map instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference... More on stackoverflow.com
๐ŸŒ stackoverflow.com
javascript - Converting object values and properties into an array - Stack Overflow
How to convert an object with names and values into an array of object just like the below format. 'result' : { "name1" : "Angle", "name2" : "Demon", "... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
JavaScript Tutorial
javascripttutorial.net โ€บ home โ€บ convert an object to an array in javascript
Convert an Object to an Array in JavaScript
March 29, 2020 - const propertyValues = Object.values(person); console.log(propertyValues); Copy ยท Output: [ 'John', 'Doe' ] Copy ยท To convert the enumerable string-keyed properties of an object to an array, you use the Object.entries() method.
๐ŸŒ
Bobby Hadz
bobbyhadz.com โ€บ blog โ€บ javascript-get-object-values-as-array
Convert an Object's Values or Keys to an Array in JavaScript | bobbyhadz
To get the values of an object as an array, use the `Object.values()` method, passing it the object as a parameter.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ how-to-convert-object-to-array-in-javascript
How to Convert Object to Array in JavaScript? - GeeksforGeeks
August 5, 2025 - This example demonstrates how to use Object.keys() and map() to convert an object into an array of objects, where each object contains a key and value property.
๐ŸŒ
Medium
medium.com โ€บ chrisburgin โ€บ javascript-converting-an-object-to-an-array-94b030a1604c
Javascript, Converting an Object to an Array of Objects. | by Chris Burgin | Spark | Medium
December 16, 2017 - Today we are going to do the opposite, convert an object to an array of objects. You may be asking why, the answer is actually quite simple. In programing we are not always in control of the format in which our data is delivered to us. With this in mind it becomes important to understand how to convert our data into our desired format. Using newer Javascript features there is an easy one liner that can achieve this result using Object.values().
๐ŸŒ
Seanconnolly
seanconnolly.dev โ€บ javascript-object-to-array
JavaScript object to array ยท Sean Connolly
If not, then you most likely discovered the downsides to each of these options. ๐Ÿ˜• Object.keys strips out the data, which you most likely need. ๐Ÿ™ Object.values strips out the key, which you also probably need. โ˜น๏ธ Object.entries returns an array of arrays, which can be difficult to reason about.
Find elsewhere
๐ŸŒ
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 - The Object.keys() and map() function are extracts keys and maps them to an array of objects using their corresponding values.
๐ŸŒ
Rip Tutorial
riptutorial.com โ€บ convert object's values to array
JavaScript Tutorial => Convert object's values to array
Given this object: var obj = { a: "hello", b: "this is", c: "javascript!", }; You can convert its values to an array by doing: var array = Object.keys(obj) .map(function(key) { return obj[key]; }); console.log(array); // ["hello", "this is", ...
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_object_values.asp
JavaScript Object.values() Method
The Object.values() method returns an array of the property values of an object.
๐ŸŒ
Favtutor
favtutor.com โ€บ articles โ€บ convert-object-to-array-javascript
Convert Object to Array in JavaScript (with code)
November 30, 2023 - The Object.values() method allows us to obtain the values corresponding to the keys of an object and store them in an array. This method was introduced in ES8 and is supported in modern browsers.
๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ 7-ways-convert-objects-array-javascript-awais-al-waisy
7 ways to convert Objects into Array in JavaScript
February 12, 2023 - To convert a JavaScript object into an array is by using the Array.from() method. The Array.from() method creates a new, shallow-copied Array instance from an array-like or iterable object.
๐ŸŒ
SamanthaMing
samanthaming.com โ€บ tidbits โ€บ 76-converting-object-to-array
Converting Object to an Array | SamanthaMing.com
Array has an array of methods (sorry, bad pun ๐Ÿ˜). So by converting the object into an array, you have access to all of that. Woohoo ๐Ÿฅณ ยท const zoo = { lion: '๐Ÿฆ', panda: '๐Ÿผ', }; Object.keys(zoo); // ['lion', 'panda'] Object.values(zoo); // ['๐Ÿฆ', '๐Ÿผ'] Object.entries(zoo); // [ ['lion', '๐Ÿฆ'], ['panda', '๐Ÿผ'] ]
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript-object-values-method
JavaScript Object values() Method | GeeksforGeeks
July 12, 2024 - 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.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ article โ€บ how-to-convert-an-object-into-an-array-in-javascript
How to convert an object into an array in JavaScript?
March 15, 2026 - Use Object.keys(), Object.values(), or Object.entries() for single objects, and Array.map() for extracting values from object arrays.