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).
We're a place where coders share, stay up-to-date and grow their careers.
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).