Created
October 25, 2016 08:07
-
-
Save bendc/54f9f4985d848fb33d6838a61c908987 to your computer and use it in GitHub Desktop.
Deep clone a Map containing JSON-compatible data
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
const clone = map => | |
new Map(JSON.parse(JSON.stringify([...map]))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: