

Ask HN: Is this a better deep cloning for JavaScript objects? - sgy
https://github.com/yazjisuhail/js/blob/master/implementations/deepClone.js#

======
Bahamut
I would recommend taking a look at lodash's source to get an idea of how an
efficient algorithm might look. On quick glance, defining the clone function
inside deepClone is inefficient. The clone function also does not account for
functions, which also are passed by reference.

