<html>
<body>
<h2>Looping JavaScript Object Values</h2>
<p id="demo"></p>
<script>
const myJSON = '{"name":"John", "age":30, "car":null}';
const myObj = JSON.parse(myJSON);
let text = "";
for (const x in myObj) {
text += myObj[x] + ", ";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjson_object_loop_bracket by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 16:49:21 GMT -->
</html>