foreach loop for object array inside array iteration in javascript code example
Example 1: iterate through object array javascript
for (var key in array) {
var obj = myArray[key];
// ...
}
Example 2: javascript for loop array of objects
var array = ["e", 5, "cool", 100];
for (let i = 0; i < array.length; i++) {
console.log(array[i]);
}
// This is a common method used to loop through elements in arrays.
// You can use this to change elements, read them, and edit them