O'Reilly logo
  • Thomas Kelly thinks this is interesting:

const rateColor = (color, rating) =>   ({     ...color,     rating   })

From

Cover of Learning React

Note

Not working. I think it should be:

const rateColor = (color, rating) => Object.assign({}, color, {rating: rating})