<html>
<body>
<h2>JavaScript Global Variables</h2>
<p>In HTML, global variables defined with <b>var</b>, will become window variables.</p>
<p id="demo"></p>
<script>
var carName = "Volvo";
// code here can use window.carName
document.getElementById("demo").innerHTML = "I can display " + window.carName;
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_let_scope by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:39:33 GMT -->
</html>