const jsonString = '{ "key": "value", "key2": ["a","b"] }';
const obj = JSON.parse( jsonString );
alert( obj.key ); // "value"
alert( obj.key2[1] ); // "b"
var oTemp = JSON.parse(buf.toString());
Copy
1const jsonStr = '{"name":"Infinitbility","gender":"male"}';
2const jsonObj = JSON.parse(jsonStr);
3console.log(jsonObj); // {name: 'Infinitbility', gender: 'male'}
4console.log(jsonObj.name); // Infinitbility
List<userdetails> details = new List<userdetails>();
userdetails user = new userdetails();
details.Add(new userdetails { userid = 1, username = "suresh", location = "chennai" });
string strserialize = JsonConvert.SerializeObject(details);