Created
April 22, 2018 10:05
-
-
Save bluemoon2014/d152f1280f829075bd3b75ae33f50072 to your computer and use it in GitHub Desktop.
JavaScript 深复制
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deepCopyObjt(argument) { | |
if (typeof argument != "object") return argument; | |
var newObjt = {}; | |
for (attr in argument){ | |
newObjt[attr] = deepCopyObjt(argument[attr]); | |
} | |
return newObjt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment