by
19
7
2,216
5
Top 1% !
Popular
Famous
Nice
Tagged
Specified
MultiPlatform
Popularity: 6907th place
Created
Modified Sep 20, 2014
Languagejavascript
LicenseMIT_X11

deep copy of your objects, and their objects, and...

cloning function
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/167355/deep-copy-of-your-objects--and-their-obj?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
// makin' copieeees! function kloneMe(objkt) { var k = {}; for(var x in objkt) { if(objkt[x] !== null && typeof(objkt[x])=="object") { k[x] = kloneMe(objkt[x]); } else { k[x] = objkt[x]; } } return k; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus