Just create the object in a local variable:
(只需在局部变量中创建对象:)
function example() {
var demo = {};
}
example();
Even if example
is a global variable and somehow tied to window
, the demo
variable is not.
(即使example
是全局变量并且以某种方式与window
绑定, demo
变量也不是。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…