today,i want to get a sum number,but get a wrong number.
function fun(a,b,c){
var l = arguments.length;
console.log('length'+l);
for(var i=0;i<l;i++){
var sum;
console.log(arguments[i]);
sum= sum+arguments[i];
}
return sum;
}
var p= fun(1,2,3);
console.log(p);
p is 'NaN'
if change the fun(1,2,3) to fun(1,2,3,4,5),is there some differences?