Skip to content

Instantly share code, notes, and snippets.

@Maslor
Created September 28, 2015 13:08
Show Gist options
  • Select an option

  • Save Maslor/02b79e0bd5905ed609ca to your computer and use it in GitHub Desktop.

Select an option

Save Maslor/02b79e0bd5905ed609ca to your computer and use it in GitHub Desktop.
javascript that sums the arguments it receives
var sum = 0;
for (cont = 2; cont < process.argv.length; cont++) {
sum += +process.argv[cont];
};
console.log(sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment