关于delete、window、global的一些小实验
var x = 1;
window.x = 2;
window.y = 3;
alert("x:" + x);
alert("delete window.x:" + delete window.x);//false
alert("x:" + x);
alert("x:" + y);
alert("delete window.x:" + delete window.y);//true
alert("x:" + y);
可以看出通过var定义的变量x用delete删除不掉
var a = 1;
window.b = 2;
alert(window.a);
alert(b);
而这里感觉window是global的浅表复制,又或是一种非普通的引用关系