Skip to content

Instantly share code, notes, and snippets.

@RikkiGibson
Created September 7, 2014 00:34
Show Gist options
  • Save RikkiGibson/f4610aade04240d719d0 to your computer and use it in GitHub Desktop.
Save RikkiGibson/f4610aade04240d719d0 to your computer and use it in GitHub Desktop.
console.log(process.argv.slice(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