var sum function var for var arguments length arguments return console

1
2
3
4
5
6
7
8
var sum = function() {
var s = 0;
for (var i = 0; i < arguments.length; i++) {
s = s + arguments[i];
}
return s;
}
console.log (sum(2, 10));