Thanks for the article! But the Object.assign creates a shallow copy and the same goes for spread syntax. If you want to create a deep copy you can use JSON parse/stringify but it works only if the object contains values that can be serialized (no functions, Maps, Date objects, etc).
Thanks for the article! But the Object.assign creates a shallow copy and the same goes for spread syntax. If you want to create a deep copy you can use JSON parse/stringify but it works only if the object contains values that can be serialized (no functions, Maps, Date objects, etc).
Hi
Or lodash Deep clone:)))