Skip to content

Instantly share code, notes, and snippets.

@jslnriot
Created August 11, 2017 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jslnriot/8f9169bd69b0cbbd9e863cc92e97deeb to your computer and use it in GitHub Desktop.
Save jslnriot/8f9169bd69b0cbbd9e863cc92e97deeb to your computer and use it in GitHub Desktop.
const argumentList = process.argv;
const addThese = argumentList.slice(2,argumentList.length);
let sum = 0;
let solution = addThese.forEach((value) => {
// convert to a number
sum += Number(value);
return sum;
});
console.log("The sum = " + sum);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment