1var person={"first_name":"Tony","last_name":"Hawk","age":31};
2var personJSONString=JSON.stringify(person);
1var jsonPerson = '{"first_name":"billy", "age":23}';
2var personObject = JSON.parse(jsonPerson); //parse json string into JS object
1<script>
2 // Convert JSON String to JavaScript Object
3 var JSONString = '[{"name":"Jonathan Suh","gender":"male"},{"name":"William Philbin","gender":"male"},{"name":"Allison McKinnery","gender":"female"}]';
4
5 var JSONObject = JSON.parse(JSONString);
6 console.log(JSONObject); // Dump all data of the Object in the console
7 alert(JSONObject[0]["name"]); // Access Object data
8</script>
9