Skip to content

Instantly share code, notes, and snippets.

@deltreey
Forked from osahyoun/gist:3236111
Created August 2, 2012 11:27
Show Gist options
  • Select an option

  • Save deltreey/3236391 to your computer and use it in GitHub Desktop.

Select an option

Save deltreey/3236391 to your computer and use it in GitHub Desktop.
JSON#stringify
var javascript_obj = {animal: 'Zebra'};
typeof javascript_obj;
// "object"
var json_obj = JSON.stringify(javascript_obj);
typeof json_obj;
// "string"
​document.write(json_obj);
// {"animal":"Zebra"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment