Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created November 27, 2017 14:06
Show Gist options
  • Save seogi1004/8e6d5a254315f17b90627d9785767352 to your computer and use it in GitHub Desktop.
Save seogi1004/8e6d5a254315f17b90627d9785767352 to your computer and use it in GitHub Desktop.
function SUM() {
var result = 0;
for(var i in arguments) {
result += arguments[i];
}
alert(result);
}
$(function() {
SUM(1);
SUM(1, 2, 3);
SUM(1, 2, 3, 4, 5);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment