for each n object code example
Example 1: loop over keys in object javascript
Object.keys(obj).forEach(function(key) {
console.log(key, obj[key]);
});
Example 2: js foreach key value
Object.keys(obj).forEach(function (key) {
// do something with obj[key]
});