What is the different between following two methods of defining js function. I have seen this is some code some one given, but could not able to call the function inside of it.
1)
function sum () {
var i, sum = 0;
for (i = 0; i < arguments.length; i += 1) {
sum += arguments[i];
}
return sum;
};
2)
var sum = function () {
var i, sum = 0;
for (i = 0; i < arguments.length; i += 1) {
sum += arguments[i];
}
return sum;
};