Object.keys: To get the keys or properties of an object as an array

PHOTO EMBED

Fri Sep 16 2022 14:08:28 GMT+0000 (Coordinated Universal Time)

Saved by @sreejithbs

const keys = Object.keys(copyPerson)
console.log(keys) //['firstName', 'age', 'country','city', 'skills','title', 'address', 'getPersonInfo']
const address = Object.keys(copyPerson.address)
console.log(address) //['street', 'pobox', 'city']
content_copyCOPY

https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/08_Day_Objects/08_day_objects.md