how to convert a javascript object to json code example
Example: how to convert normal object to json object in javascript
var obj = { name: "John", age: 30, city: "New York" };
var myJSON =
JSON.stringify(obj);
document.getElementById("demo").innerHTML = myJSON;