If I defined an object in JS with:
var j={\"name\":\"binchen\"};
How can I convert the object to JSON? The output string should be:
Use this,
var j={"name":"binchen"}; var myJSON = JSON.stringify(j);