for(key in obj) code example
Example 1: loop key in object
const fruits = { apple: 28, orange: 17 }
for(key in fruits){
console.log(key)
}
Example 2: for key value in object javascript
for (const [key, value] of Object.entries(object1)) {
console.log(`${key}: ${value}`);
}