Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

iterate over array of objects javascript

// Find an element in an array

const people = [ {name: "john", age:23},
                {name: "john", age:43},
                {name: "jim", age:101},
                {name: "bob", age:67} ];

const john = people.find(person => person.name === 'john');
console.log(john);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #iterate #array #objects #javascript
ADD COMMENT
Topic
Name
2+3 =