DEV Community

Discussion on: Deep Clone of JS Objects with circular dependency

Collapse
 
ndaidong profile image
Dong Nguyen

my pleasure! Thank you for your compliments.
Shallowing is a big issue here because we need a deepClone method. Please try to fix it :)
In another reply you mentioned to lodash. I've taken a look on their solution:
github.com/lodash/lodash/blob/mast...
The problem seems to be more complicated than we think, so they need a lot of code to deal with.

Thread Thread
 
salyadav profile image
Saloni Yadav

Hey, thanks for sharing the source code. It is pretty huge with a lot of cases for various scenarios. Indeed looks like its way more twisted than a recursive call. Pretty interesting all the same!