function add(...others) {
alert(others);
alert(others.length);
if(others.length === 1){
return function (another) {
others.push(another);
return add(others);
}
}else if (others.length > 1){
alert("aaa");
alert(others[0] + others[1]);
return others[0] + others[1];
}else{
alert("dd");
return undefined;
}
}
add(2)(3);//没有报错,alert依次输出 2 1 2,3 1,为什么最后是1而不是二?
回首忆惘然
慕桂英3389331
相关分类