Created
September 1, 2015 06:15
-
-
Save tjunghans/ded00c143a1c6d0c22c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// add n amount of arguments together | |
function add() { | |
var sum = 0; | |
var i; | |
var len = arguments.length; | |
for (i = 0; i < len; i++) { | |
sum += Number(arguments[i]); | |
} | |
return sum; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment