Skip to content

Instantly share code, notes, and snippets.

@shaunwallace
Created November 19, 2014 14:50
Show Gist options
  • Save shaunwallace/0b06df193f16c31baa65 to your computer and use it in GitHub Desktop.
Save shaunwallace/0b06df193f16c31baa65 to your computer and use it in GitHub Desktop.
JSON.parse()
JSON.parse('{"foo" : "true", "bar" : "false"}'); // returns Object { foo : true, bar : false }
// returns Object {p: 10}
JSON.parse('{"p": 5}', function (k, v) {
if(k === "") return v; // if topmost value, return it,
return v * 2; // else return v * 2.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment