for each key value java script code example
Example 1: javascript iterate object key values
Object.entries(obj).forEach(([key, value]) => {
console.log(key, value);
});
Example 2: js foreach key value
Object.keys(obj).forEach(function (key) {
// do something with obj[key]
});