Object.assign () can copy the properties of an object to another object which
Define a blank object breakfast
let breakfast={}
Here use Object.assign () method
The first parameter is the recipient, that is to be copied to the target, and the second is a copy of the source;
example:
let breakfast={} Object.assign( breakfast, { drink:'beer' } ) console.log(breakfast) //{drink:'beer'}