Skip to main content

json stringify

  • var obj = {a: "a", b: "b" /*...*/};
    var string = JSON.stringify(obj);
    // OUTPUT:
    // "{'a':'a', 'b':'b'}"
  • var obj = { name: "John", age: 30, city: "New York" };
    var myJSON = JSON.stringify(obj);
  • Back to code snippet queries related javascript