The spread syntax will copy all the properties of the object, but will only create a new object at the top level. For nested objects, the references of the inner objects will be copied and will not create new ones. You can simply do so by using the function in Array’s prototype.

1m read time From javascript.plainenglish.io
Post cover image
18 Comments

Sort: