Created
November 21, 2014 03:33
-
-
Save GZShi/b58ff55609c8c1991677 to your computer and use it in GitHub Desktop.
Object clone
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 clone(obj) { | |
return JSON.parse(JSON.stringify(obj)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment