Created
February 5, 2016 01:57
-
-
Save robertu7/9158a9995d6d43867f59 to your computer and use it in GitHub Desktop.
Javascript JSON.parse and JSON.stringify
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
// Deep Copy https://jsperf.com/deep-copy-vs-json-stringify-json-parse | |
var copy = JSON.parse(JSON.stringify(targetObject)) | |
// Find and Modify Deeply Nested Object | |
JSON.parse(JSON.stringify(targetObject).replace(/replaceThis/g, 'toThis')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment