var strOwn= '{"name1":"jack1","two":{"name2":"jack2","name22":"jack22"},"name3":"jack3"}';
var str= '{ "employees" : [' +
'{ "firstName":"Bill" , "lastName":"Gates" },' +
'{ "firstName":"George" , "lastName":"Bush" },' +
'{ "firstName":"Thomas" , "lastName":"Carter" } ]}';
var JSONObject= {
"name":"Bill Gates",
"street":"Fifth Avenue New York 666",
"age":56,
"phone":"555 1234567"};
var objOwn= JSON.parse(strOwn);
var obj = JSON.parse(str);
console.log("strOwnType: "+typeof strOwn);
console.log("strType: "+typeof str);
console.log("JSONObjectType:"+typeof JSONObject);
console.log(obj);
var str= '{ "employees" : [' +
'{ "firstName":"Bill" , "lastName":"Gates" },' +
'{ "firstName":"George" , "lastName":"Bush" },' +
'{ "firstName":"Thomas" , "lastName":"Carter" } ]}';
var JSONObject= {
"name":"Bill Gates",
"street":"Fifth Avenue New York 666",
"age":56,
"phone":"555 1234567"};
var objOwn= JSON.parse(strOwn);
var obj = JSON.parse(str);
console.log("strOwnType: "+typeof strOwn);
console.log("strType: "+typeof str);
console.log("JSONObjectType:"+typeof JSONObject);
console.log(obj);
console.log(objOwn);
console.log(JSON.stringify(objOwn));