DEV Community

Discussion on: Memory Life cycle, Heap, Stack and Call Stack in JavaScript

Collapse
cernym43 profile image
Marek Černý

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).

Collapse
hayk1997 profile image
Hayk-1997

Hi
Or lodash Deep clone:)))