by
19
6
665
6
Top 1% !
Popular
Nice
Tagged
Specified
MultiPlatform
Popularity: 3271st place
Created
Modified Sep 20, 2014
Languagejavascript
LicenseMIT_X11

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

cloning function
post this code
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