itterate over array object values code example
Example 1: iterate through object array javascript
for (var key in array) {
var obj = myArray[key];
// ...
}
Example 2: 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);