Skip to content

Instantly share code, notes, and snippets.

@nealalan
Created August 5, 2019 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nealalan/7b60721f35610fd8103aca99997746c8 to your computer and use it in GitHub Desktop.
Save nealalan/7b60721f35610fd8103aca99997746c8 to your computer and use it in GitHub Desktop.
JSON: JavaScript Object Notation Example

JSON: JavaScript Object Notation

  • JSON.stringify and JSON.parse
let string = JSON.stringify({squirrel: false,
                             events: ["weekend"]});
console.log(string);
// → {"squirrel":false,"events":["weekend"]}
console.log(JSON.parse(string).events);
// → ["weekend"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment