<html>
<body>
<h2>for/in loop in JavaScript</h2>
<p id="demo"></p>
<script>
let txt = '';
// define an object
let person = {fname:"ram", lname:"singh", age:89};
let x;
for(x in person)
{
// x is the key like fname, lname and age
txt += person[x] + " ";
}
document.getElementById("demo").innerHTML = txt;
</script>
</body>
</html>