Object to json
var obj = {}; obj.name = "Raj"; obj.age = 32; obj.married = false; var jsonString= JSON.stringify(obj);