Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var sum = function() {
var i, sum = 0;
for (i = 0; i < arguments.length; i += 1) {
sum += arguments[i];
}
return sum;
}
console.log(sum(4, 8, 15, 16, 23, 42)); // 108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment