DEV Community

loading...

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