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>JavaScript Variables</h2> <p>A variable can chang its type. In this example x is first a string then a number:</p> <p id="demo"></p> <script> let x = "Hello"; x = 5; document.getElementById("demo").innerHTML = typeof x; </script> </body> </html>