How does the spread operator assist in merging and overriding properties of multiple objects?

  • It creates a shallow copy of the objects and combines their properties.
  • It performs a deep merge of the objects' properties.
  • It only merges properties at the top level of the objects.
  • It only works with objects of the same type.
The spread operator creates a shallow copy of the objects, meaning it only copies the top-level properties. It assists in merging by combining these properties, but it does not perform a deep merge of nested properties.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *