Created
September 6, 2014 23:07
-
-
Save RikkiGibson/b7ca5d2e38f41412bf4b to your computer and use it in GitHub Desktop.
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
console.log(process.argv.splice(2) | |
.reduce(function(a, b) { | |
return Number(a) + Number(b) | |
})); | |
var total = 0; | |
for (var i = 2; i < process.argv.length; i++) { | |
total += parseInt(process.argv[i]); | |
} | |
console.log(total); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment