const x = 123

const y = {
  x
}

y
// { x: 123 }

That is the equivalent of setting:

const y = {
  x: x
}