var obj = {a: "a", b: "b" /*...*/}; var string = JSON.stringify(obj); // OUTPUT: // "{'a':'a', 'b':'b'}"
num.toString();
var person={"first_name":"Tony","last_name":"Hawk","age":31}; var personJSONString=JSON.stringify(person);
var obj = { name: "John", age: 30, city: "New York" }; var myJSON = JSON.stringify(obj); document.getElementById("demo").innerHTML = myJSON;