Can someone help me define an object property asynchronously? My example below returns `name : undefined and I can't find any strategies on how to do this synchronously...
function returnName () {
setTimeout(function() {
return 'John Wick'
}, 3000);
}
const person = {
name: returnName(),
age: 23
}
console.log(person) // person.name returns `undefined`
Thanks in advance!