Actually It creates deep copies of data if the data is not nested. But when you have nested data in an array or object the spread operator will create a deep copy of the top most data and a shallow copy of the nested data.
Hope this clarifies.
Yeah exactly
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Actually It creates deep copies of data if the data is not nested. But when you have nested data in an array or object the spread operator will create a deep copy of the top most data and a shallow copy of the nested data.
Hope this clarifies.
Yeah exactly