Skip to content

Instantly share code, notes, and snippets.

@Ajax30
Last active September 5, 2020 11:26
Show Gist options
  • Save Ajax30/95e1db24a48f02c0353823c200ec2062 to your computer and use it in GitHub Desktop.
Save Ajax30/95e1db24a48f02c0353823c200ec2062 to your computer and use it in GitHub Desktop.
Add all function argumens
const addUp = (...numbers) => {
var sum = 0;
numbers.forEach(function(item) {
sum = sum + item;
});
return sum;
}
console.log(addUp(1, 5, 6));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment