iterate over object javascript good code example
Example 1: javascript loop through object
Object.entries(obj).forEach(
([key, value]) => console.log(key, value)
);
Example 2: iterate object js
for (let key in yourobject) {
if (yourobject.hasOwnProperty(key)) {
console.log(key, yourobject[key]);
}
}