Last active
September 5, 2020 11:26
-
-
Save Ajax30/95e1db24a48f02c0353823c200ec2062 to your computer and use it in GitHub Desktop.
Add all function argumens
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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