220k views
4 votes
Assign json Data with the parsed value of the string Structure variable. Then, assign "Power forward" to the position property in json Data and assign string Structure with the stringified version of json Data.

1 Answer

3 votes

Answer:

Answer is provided in the explanation section

Step-by-step explanation:

Code:

<script>

var stringStructure = '{ "name": " Andrew ", "height": { "ft": 6, "in": 6 }, "points": 25, "position":

"Small forward" }';

var jsonObject = JSON.parse(stringStructure);

jsonObject.position = "Power forward";

var stringStructure = JSON.stringify(jsonObject);

document.getElementById("demo").innerHTML = stringStructure;

</script>

Running code in editor with output:

Assign json Data with the parsed value of the string Structure variable. Then, assign-example-1
User Amanpurohit
by
4.3k points