x
 
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Objects</h2>
<p>Display object properties:</p>
<p id="demo"></p>
<script>
const person = {
  name: "John",
  age: 30,
  city: "New York"
};
let txt = "";
for (let x in person) {
  txt += person[x] + " ";
};
document.getElementById("demo").innerHTML = txt;
</script>
</body>
</html>