Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript return object property from array

// ES5 compatible browsers
let result = objArray.map(a => a.foo);
OR
let result = objArray.map(({ foo }) => foo)

// FOR IE8 or older
var result = objArray.map(function(a) {return a.foo;});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #return #object #property #array
ADD COMMENT
Topic
Name
6+8 =