function makeSum var args var var number function for var arguments le

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
function makeSum () {
var args = [];
var f;
var number = function () {
for(var i = 0;i<arguments.length;i++){
if (typeof (arguments[i]) != "function"){
args[i] = arguments[i];
} else {
f = arguments[i];
break;
}
}
return f ? args.reduce(f) : number;
};
return number;
}