Answer:
The solution is written in JavaScript:
- var stringData = '{ "name": "Michael Jordan", "height": { "ft": 6, "in": 6 }, "points": 25, "position": "Power forward" }';
- var jsonData = JSON.parse(stringData);
- jsonData.points = 29;
- stringData = JSON.stringify(jsonData);
Step-by-step explanation:
Given the string data as in Line 1, we use the JSON parse method to convert the string data into JavaScript object (Line 2) and assign the parsed data to variable jsonData.
Next, use the dot syntax to access the points property of the jsonData and set the value of 29 to it (Line 3).
At the end, use JSON stringify method to stringify the jsonData and assign the output to stringData (Line 4).