how can i get the key name of the iterated item of a forEach loop?
const obj = {
var1: 1,
var2: 2,
var3: 3,
}
obj.forEach((item) => {
console.log(item.keyName) // o want to get var1, var2 and var3 on the console
})
how can i get the key name of the iterated item of a forEach loop?
const obj = {
var1: 1,
var2: 2,
var3: 3,
}
obj.forEach((item) => {
console.log(item.keyName) // o want to get var1, var2 and var3 on the console
})