Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

iterate over array of objects javascript

// Transform to a new array

const myArray = [{x:100}, {x:200}, {x:300}];

const newArray= myArray.map(element => element.x);
console.log(newArray); // [100, 200, 300]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #iterate #array #objects #javascript
ADD COMMENT
Topic
Name
5+6 =