I have a JavaScript object array. When write console.log(myarry) it will show in the console in the below form.
console.log(myarry)
Array[2] 0: Object one: \"one\"
Here's an interesting way to do it.
const arr = [{ one: 'one' }, { two: 'two' }]; Object.entries(arr).forEach(([_, obj]) => { const key = Object.keys(obj)[0]; console.log(`Key is ${key}, value is ${obj[key]}.`); });