chrome和firefox javascript控制台 - 不同的返回值

时间:2012-05-12 18:20:31

标签: javascript firefox google-chrome console

  

可能重复:
  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

0 个答案:

没有答案