如题,第一个括号中的值可以用arguments来取得,怎样取第二个括号中的值?
以及:为什么function(b)取的就是第二个括号中的值呢?怎么取的呢?这一块很困惑。
if(args.length == 1){
a= args[0];
//Check the argument using typeof
if(typeof a!=='number'){
return undefined;
}
else{
//Making use of closures
return function(b){
//Checking the second argument
if(typeof b !=='number'){
return undefined;
}
else
return a+b;
};
}
}