how to get values from array of objects in javascript code example
Example 1: array objects to array of one property
let result = objArray.map(a => a.foo);
Example 2: object get array of values
const data = {
"2015": {
"year": 2015,
"cover": {}
}
}
Object.entries(data).forEach(([key, value]) => console.log(key, value));
Example 3: map a property from array of objects javascript
var result = objArray.map(function(a) {return a.foo;});