O'Reilly logo
  • Edward Yasi thinks this is interesting:

 const​ book = {​  title: ​'Reasons and Persons'​,​  author: ​'Derek Parfit'​,​ };​ 


Cover of Simplifying JavaScript


Example of using spread operator to assign default values to an object, although default value of 1984 should come BEFORE ...book so if the book has a year it will be preserved.

See following highlight for final version that should actually be used.