array of object to array of values code example
Example 1: javascript object to array
//ES6 Object to Array
const numbers = {
one: 1,
two: 2,
};
console.log(Object.values(numbers));
// [ 1, 2 ]
console.log(Object.entries(numbers));
// [ ['one', 1], ['two', 2] ]
Example 2: array objects to array of one property
let result = objArray.map(a => a.foo);
Example 3: map a property from array of objects javascript
var result = objArray.map(function(a) {return a.foo;});