DEV Community

Discussion on: Alternative to the spread operator

Collapse
 
brianmcoates profile image
Brian

If you just want the original value of pizza you just put the object to the right so in

Object.assign(moreFood, food)

and with the spread operator you can

{...moreFood, food}