JS全局变量是如何工作的?
<script>
const one = 1;
var two = 2;
</script>
<script>
// All scripts share the same top-level scope:
console.log(one); // 1
console.log(two); // 2
// Not all declarations create properties of the global object:
console.log(window.one); // undefined
console.log(window.two); // 2
</script>