how to iterate over an object js code example
Example 1: javascript loop through object
Object.entries(obj).forEach(
([key, value]) => console.log(key, value)
);
Example 2: loop through object javascript
for (var property in object) {
if (object.hasOwnProperty(property)) {
// Do things here
}
}