函数有两个特殊对象,arguments和this,
arguments是一个包含着所有传入函数中的参数的类数组对象,
例如
function test1(a,b){
alert(a + b);
}
function test2(a,b){
alert(arguments[0]+arguments[1]);
}
test1和test2的结构是一样的
arguments是一个包含着所有传入函数中的参数的类数组对象,
例如
function test1(a,b){
alert(a + b);
}
function test2(a,b){
alert(arguments[0]+arguments[1]);
}
test1和test2的结构是一样的