Skip to content

Instantly share code, notes, and snippets.

@GZShi
Created November 21, 2014 03:33
Show Gist options
  • Save GZShi/b58ff55609c8c1991677 to your computer and use it in GitHub Desktop.
Save GZShi/b58ff55609c8c1991677 to your computer and use it in GitHub Desktop.
Object clone
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