Javascript: JSON

(Last Updated On: )

This post shows you how to parse string to json and then back again.

String to Json

var doc = null;
	
try {
	doc = JSON.parse(value);
}
catch(ex) {
	//handle exception
}

Json to string

JSON.stringify(value));