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 the JSON.stringify() method:
JSON.stringify()
const stringified = JSON.stringify({}) // pass object you want to convert in string format