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> <h2>JSON.stringify() converts date objects into strings.</h2> <p id="demo"></p> <script> const obj = {name: "John", today: new Date(), city: "New York"}; const myJSON = JSON.stringify(obj); document.getElementById("demo").innerHTML = myJSON; </script> </body> </html>