DEV Community

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

Collapse
 
rakeshpatel09 profile image
Rakesh Patel • Edited

Very good bhai.

just one note, spread operator does a shallow clone ( copy ) not deep clone

Collapse
 
thekrprince profile image
Kumar Prince

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