9951 explained code solutions for 126 technologies


javascriptExtract certain object properties values as array from array of objects


var arr = [{a: 1}, {a: 2}, {a: 3}];
var props = arr.map(el => el.a);ctrl + c
var arr

declare test object array

props

array will contain array of selected properties values

arr.map(el => el.a)

build an array of a properties of objects in arr array