DEV Community

loading...

Discussion on: Spread operator, Rest Operator & Destructuring in JS

Collapse
thekrprince profile image
Kumar Prince Author

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.

Collapse
rakeshpatel09 profile image
Rakesh Patel

Yeah exactly