x
1
2
<html>
3
<body>
4
5
<h2>Creating an Object Parsing JSON</h2>
6
<p id="demo"></p>
7
8
<script>
9
const myJSON = '{"name":"Ahmed", "age":30, "car":null}';
10
const myObj = JSON.parse(myJSON);
11
document.getElementById("demo").innerHTML = myObj.name;
12
</script>
13
14
</body>
15
</html>