可能重复:
Is Chrome's JavaScript console lazy about evaluating arrays?
对于这个匿名函数,我有不同的输出,这取决于我使用的是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