score:2

Accepted answer
const house = Object.assign({}, 
  {open: 0},
  props.door && {close: 0}
);

Related Query

More Query from same tag