Not all global variables get assigned to the window object. For example:
<script>
let foo = "bar";
</script>
<script>
console.log(foo); // prints "bar"
console.log(window.foo); // prints "undefined"
</script>