Created
March 21, 2015 16:15
-
-
Save gerasimua/6a19751e6ac5c42bb06f to your computer and use it in GitHub Desktop.
Easiest way to clone js objects without pointers
This file contains hidden or 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(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