Created
June 11, 2014 07:57
-
-
Save Torthu/94b3b435f41a8db077c6 to your computer and use it in GitHub Desktop.
Simple deep clone
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
| # Simple deep clone function | |
| deepClone = (originalObject) -> | |
| JSON.parse(JSON.stringify(originalObject)) | |
| clone = deepClone | |
| a: 'a' | |
| b: | |
| c: 'c' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment