通过一个例子来理解下arguments与arguments.callee的具体区别:
代码如下:
代码如下:
');
document.write("ex:" + ex + '
'); if (ac != ex) { document.write("wrong number of arguments: expected: " + ex + "; actually passed" + ac + '
'); } } function f(x,y,z) { check(arguments); document.write(x + y + z); }
'); if (ac != ex) { document.write("wrong number of arguments: expected: " + ex + "; actually passed" + ac + '
'); } } function f(x,y,z) { check(arguments); document.write(x + y + z); }
代码如下: