Your global variables (or functions) can overwrite window variables (or functions).
Any function, including the window object, can overwrite your global variables and functions.
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
说白了,在浏览器里,
window就是个存放全局变量的对象,window.x等同于全局变量x,所以会相互覆盖。这个做法和 Lua 的
_G一样。