<p id="demo"></p>
<script>
const person = {
name: "John",
age: 30,
city: "New York"
};
document.getElementById("demo").innerHTML = JSON.stringify(person);
</script>
result:
Display properties in JSON format:
{"name":"John","age":30,"city":"New York"}