开发者

"arguments" property in Chrome has functionality changed?

Here is my case:

function x(a) {
    console.log(a + '=' + arguments[1]);
}
x('arg0', 'arg1');

In Firefox 4 and not so long ago in Chrome, this was the content of 'arguments':

arguments[0]开发者_运维百科 = 'arg0';
arguments[1] = 'arg1';

In Chrome, now only the named arguments are in the arguments array. So it's only 1 long, instead of 2.

So my questions:

  1. When and how did this change?
  2. How can I make this work again?


function x(a) {
    console.log(a + '=' + arguments[1]);
}
x('arg0', 'arg1');

Result:

arg0=arg1

It works just fine on Chrome, you just have to name the function, otherwise it's not callable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜