iterate over array of object javascript and access the properties
yourArray.forEach(function (arrayItem) {
var x = arrayItem.prop1 + 2;
console.log(x);
});
3.67
3
for (let item of items) {
console.log(item); // Will display contents of the object inside the array
}
Thank you!
3
0
Are there any code examples left?
New code examples in category Javascript