Is there a way to simplify this expression?
const car = { owner: 'john' }
const assets = { house: { owner: 'paul'}, car: car}
As the key
in assets takes the variable name car
, is it a way to avoid redefining the key name?
Something like this:
const assets = { house: { owner: 'paul'}, car}
Thank you!