<html>
<body>
<h1>JavaScript Variables</h1>
<p>In this example, x, y, and z are undeclared.</p>
<p>They are automatically declared when first used.</p>
<p id="demo"></p>
<script>
x = 5;
y = 6;
z = x + y;
document.getElementById("demo").innerHTML =
"The value of z is: " + z;
</script>
</body>
<!-- /js/tryit.asp?filename=tryjs_variables_undeclared Thu, 06 Feb 2025 19:15:21 GMT -->
</html>