I researched this but only found articles (or threads) about getting the class name
For example:
const john = {
firstName: this.constructor.name,
lastName: 'smith'
}
console.log(john.firstName) // john
How can I access the object name as string so it outputs 'john' ?