Object Extensions

#with object extensions

const options = {
  ...defaults,
  visible: true
}

#No object extension

const options = Object.assign(
  {}, defaults,
  { visible: true })

The object spread operator allows you to build new objects from other objects. See: Object Spread

Comments