1var person={"first_name":"Tony","last_name":"Hawk","age":31};
2var personJSONString=JSON.stringify(person);
1const myObj = {
2 name: 'Skip',
3 age: 2,
4 favoriteFood: 'Steak'
5};
6
7const myObjStr = JSON.stringify(myObj);
8
9console.log(myObjStr);
10// "{"name":"Skip","age":2,"favoriteFood":"Steak"}"
11
12console.log(JSON.parse(myObjStr));
13// Object {name:"Skip",age:2,favoriteFood:"Steak"}