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:
You can use JSON.stringify() method to convert JSON object to String.
var j={"name":"binchen"}; JSON.stringify(j)
For reverse process, you can use JSON.parse() method to convert JSON String to JSON Object.