Для значения ключа в JavaScript Object
for (const [key, value] of Object.entries(object1)) {
console.log(`${key}: ${value}`);
}
Smoggy Shark
for (const [key, value] of Object.entries(object1)) {
console.log(`${key}: ${value}`);
}
const fruits = { apple: 28, orange: 17 }
for(key in fruits){
console.log(key)
}