array javascript loop over get object value code example
Example 1: javascript loop through array of objects
var arr = [{id: 1},{id: 2},{id: 3}];
for (var elm of arr) {
console.log(elm);
}
Example 2: iterate over array of object javascript and access the properties
for (let item of items) {
console.log(item); // Will display contents of the object inside the array
}