1var mystr = '{ "hello":"world" }' // NB: Has enclosing ""
2var myobj = JSON.parse(mystr);
1var jsonPerson = '{"first_name":"billy", "age":23}';
2var personObject = JSON.parse(jsonPerson); //parse json string into JS object
1const json = '{ "fruit": "pineapple", "fingers": 10 }';
2const obj = JSON.parse(json);
3console.log(obj.fruit, obj.fingers);
1var json_data = {"2013-01-21":1,"2013-01-22":7};
2var result = [];
3
4for(var i in json_data)
5 result.push([i, json_data [i]]);
6
7
8var data = new google.visualization.DataTable();
9data.addColumn('string', 'Topping');
10data.addColumn('number', 'Slices');
11data.addRows(result);
12
1
2const obj = JSON.parse('{"assetType": "OPTION",
3"putCall ": "CALL",
4"contractType": "CALL",
5"strikePrice": "700",
6"premium": "6.00",
7"comment": "",
8"parsed": true }');
9