var sum = function(x,y,z) {is an anonymous function. That means sub is now 6. If you call sum with any arguments it will bark at you. Where as this:
return (x+y+z);
}(1,2,3);
var sum = function(x,y,z) {is a named function. Sum is a function that accepts 3 arguments. If you call sub(2,3,5), it will return 10.
return (x+y+z);
};
No comments:
Post a Comment