I know that json.stringify() function converts a json object to json string.
json.stringify({x:9})
this will return string "{"x" : 9}"
But is there a way to convert a simple string into json format? For example i want this
var str = '{x: 9}'
json.stringify(str) //"{"x" : 9}"