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
🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-convert-array-of-objects-to-array-of-values
Convert an Array of Objects to an Array of Values in JS | bobbyhadz
March 4, 2024 - To convert an array of objects to an array of values, use the `Array.map()` method to iterate over the array. On each iteration, return the value.
Discussions

javascript - Get array of property values from array of objects with jquery - Stack Overflow
Obviously I could just loop it and build the array but I need to do this a large number of times on a variety of objects. I could write a function to do it but it would be difficult to make the function general enough for my application. ... You have to use jquery loop. I hope this will help to you dear. stackoverflow.com/questions/2342371/… ... Native javascript ... More on stackoverflow.com
🌐 stackoverflow.com
javascript - Get values from an array of objects - Stack Overflow
0 Javascript Array of objects - how do i loop through and get the object values More on stackoverflow.com
🌐 stackoverflow.com
javascript - How to obtain the object values from an array with one object and create a new array with just the object values - Stack Overflow
Provided that the array has just one object, you can simply assign Object.values of that particular object to a new variable. More on stackoverflow.com
🌐 stackoverflow.com
Get all the values from an array of objects
I want to print all thumbnail_image because the above code it’s giving me only one image multiple times but I need to display each image of objects · This list.posts[0] seems to suggest posts is an array, but this Object.keys(list.posts) seems to suggest it’s an object you are turning ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
1
0
June 1, 2021
People also ask

Q8. How can I get object property values as an array in JavaScript?
Use ‘Object.values(object)’ to retrieve all values from an object as an array.
🌐
intellipaat.com
intellipaat.com › home › blog › how to extract given property values from objects as array in javascript?
How to Extract Given Property Values from Objects as Array in ...
Q7. How does JavaScript get array of specific property values from an object collection?
Use ‘array.map(obj => obj.propertyName)’ to extract specific property values into an array.
🌐
intellipaat.com
intellipaat.com › home › blog › how to extract given property values from objects as array in javascript?
How to Extract Given Property Values from Objects as Array in ...
Q9. How to extract values in JavaScript efficiently from an object or array?
Use ‘Object.entries(object)’, ‘Object.keys(object)’, or ‘map()’ for structured data extraction.
🌐
intellipaat.com
intellipaat.com › home › blog › how to extract given property values from objects as array in javascript?
How to Extract Given Property Values from Objects as Array in ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-get-values-from-specific-objects-an-array-in-javascript
How to get Values from Specific Objects an Array in JavaScript ? - GeeksforGeeks
August 5, 2025 - You can use map() to create a new array of values from the properties of the objects in the original array. Example: The below example demonstrates How to get values from specific objects inside an array in JavaScript Using the map() method.
🌐
Programiz
programiz.com › javascript › examples › extract-value-array
JavaScript Program to Extract Given Property Values from Objects as Array
// program to extract value as an array from an array of objects function extractValue(arr, prop) { let extractedValue = []; for (let i=0; i < arr.length ; ++i) { // extract value from property extractedValue.push(arr[i][prop]); } return extractedValue; } const objArray = [{a: 1, b: 2}, {a: ...
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-extract-value-of-a-property-as-array-from-an-array-of-objects
How to extract value of a property as array from an array of objects ? - GeeksforGeeks
July 23, 2025 - Create a temporary array inside the function in which results will be stored and printed later. Then using the for-of loop, iterate over the values of that array of objects and thereafter select values for the desired chosen key.
🌐
TutorialsPoint
tutorialspoint.com › article › retrieve-key-and-values-from-object-in-an-array-javascript
Retrieve key and values from object in an array JavaScript
March 15, 2026 - const students = [ {name: 'Alice', grade: 'A', subject: 'Math'}, {name: 'Bob', grade: 'B', subject: 'Science'} ]; students.forEach((student, index) => { console.log(`\nStudent ${index + 1}:`); Object.entries(student).forEach(([key, value]) => { console.log(` ${key}: ${value}`); }); }); Student 1: name: Alice grade: A subject: Math Student 2: name: Bob grade: B subject: Science · The time complexity is O(n × m), where n is the number of objects in the array and m is the average number of properties per object.
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › array › pluck values from object array
Pluck values from an array of objects in JavaScript - 30 seconds of code
March 22, 2024 - Instead of having two separate functions for plucking a single value and multiple values, you can create a single function that accepts a variable number of keys. This way, you can pluck any number of values for each object.
🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-get-object-values-as-array
Convert an Object's Values or Keys to an Array in JavaScript | bobbyhadz
The Object.fromEntries() method converts an array of key-value pairs to an object. You can also use the Object.keys() method to get an object's values as an array.
🌐
TutorialsPoint
tutorialspoint.com › article › how-to-convert-object-s-array-to-an-array-using-javascript
How to convert Object's array to an array using JavaScript?
March 15, 2026 - Loop through the array of objects using for...of loop · Extract values from each object using Object.values()
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-access-array-of-objects-in-javascript
How to Access Array of Objects in JavaScript ? - GeeksforGeeks
Using the map() method, you can access and transform elements in an array of objects. It applies a function to each object, returning a new array with modified data or specific properties from the original objects.
Published: July 23, 2025
🌐
freeCodeCamp
freecodecamp.org › news › how-to-access-properties-from-an-array-of-objects-in-javascript
How to Access Properties from an Array of Objects in JavaScript
February 29, 2024 - ... To access an element from an array, you reference the array name, followed by a pair of square brackets containing the index of the element you want to access. Here is an example of accessing the first element from the fruits array:
🌐
freeCodeCamp
forum.freecodecamp.org › curriculum help
Get all the values from an array of objects - Curriculum Help - The freeCodeCamp Forum
June 1, 2021 - I want to print all thumbnail_image because the above code it’s giving me only one image multiple times but I need to display each image of objects · This list.posts[0] seems to suggest posts is an array, but this Object.keys(list.posts) seems to suggest it’s an object you are turning ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Array › from
Array.from() - JavaScript - MDN Web Docs
1 week ago - The Array.from() static method creates a new, shallow-copied Array instance from an iterable or array-like object.
🌐
Designcise
designcise.com › web › tutorial › how-to-extract-specific-keys-values-from-an-array-of-objects-in-javascript
JS Extract Specific Key's Values From Array of Objects - Designcise
June 1, 2021 - Let's suppose you have the following ... ways: Using Array.prototype.map() You can use the Array.prototype.map() method to create a new array consisting of only specific key's values....
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Object › values
Object.values() - JavaScript - MDN Web Docs
1 week ago - The Object.values() static method returns an array of a given object's own enumerable string-keyed property values.
🌐
Medium
medium.com › @lama.ibrahim96 › 5-ways-to-find-a-value-in-an-array-of-objects-in-javascript-130fa4856e53
5 ways to find a value in an array of objects in Javascript | by Lama Ibrahim | Medium
April 5, 2023 - return A shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned. Array.filter() returns an array of all the objects that pass the test implemented by the provided function, if we want to return only the first user we can return index 0 of the returned array.
🌐
Intellipaat
intellipaat.com › home › blog › how to extract given property values from objects as array in javascript?
How to Extract Given Property Values from Objects as Array in JavaScript?
July 19, 2025 - Extracting specific property values from an array of objects is a fundamental skill in JavaScript, especially when working with structured data from APIs, forms, or databases. By using methods like map(), you can efficiently transform complex ...