Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

iterate over array of objects javascript

// Retrieve a subset of an array based on particular criteria

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

const newArray = myArray.filter(element => element.x > 250);
console.log(newArray); // [{x:300}] 
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #iterate #array #objects #javascript
ADD COMMENT
Topic
Name
5+7 =