Created
February 11, 2015 01:11
-
-
Save tyfkda/48027583b64be0dd8625 to your computer and use it in GitHub Desktop.
JSON on JS
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() { | |
| var json = {a: 1, b: 2}; | |
| // Encode. | |
| var str = JSON.stringify(json); | |
| // Decode. | |
| var decoded = JSON.parse(str); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment