Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Objects</h1> <h2>Display Properties with JSON</h2> <p id="demo"></p> <script> // Create an Object const person = { name: "John", age: 30, city: "New York" }; // Display JSON document.getElementById("demo").innerHTML = JSON.stringify(person); </script> </body> </html>