Skip to content

Instantly share code, notes, and snippets.

@gerasimua
Created March 21, 2015 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerasimua/6a19751e6ac5c42bb06f to your computer and use it in GitHub Desktop.
Save gerasimua/6a19751e6ac5c42bb06f to your computer and use it in GitHub Desktop.
Easiest way to clone js objects without pointers
function clone(object){
var copy = JSON.stringify(object);
return JSON.parse(copy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment