how do i loop through named array of objects javascript code example
Example 1: js loop through associative array
var months = [];
months["jan"] = "January";
months["feb"] = "February";
months["mar"] = "march";
for (var key in months) {
var value = months[key];
console.log(key, value);
}
Example 2: javascript loop through array of objects
let arr = [object0, object1, object2];
for (let elm of arr) {
console.log(elm);
}