Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js loop over array of objects extract value

var myArr = [{name: 'rich', secondName: 'james'}, {name: 'brian', secondName: 'chris'}];

var mySecondArr = myArr.map(x => x.name);
console.log(mySecondArr);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #loop #array #objects #extract
ADD COMMENT
Topic
Name
1+8 =