对于这个匿名函数,我有不同的输出,这取决于我使用的是 Chrome 开发者控制台还是 Firefox Firebug。为什么会这样?
(function(){
var t =["one","two"];
console.log(t)
function a(m){
t[2]="three";
console.log(t)
};a(t)
function b(n){
t[3]="four";
console.log(t)
};b(t)
}())
["one", "two", "three", "four"]
["one", "two", "three", "four"]
["one", "two", "three", "four"] // chrome output
["one", "two"]
["one", "two", "three"]
["one", "two", "three", "four"]// firebug output