Skip to content

Instantly share code, notes, and snippets.

@MurhafSousli
Created April 9, 2019 07:34
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 MurhafSousli/4354ea54734098863ff65518e132fd8a to your computer and use it in GitHub Desktop.
Save MurhafSousli/4354ea54734098863ff65518e132fd8a to your computer and use it in GitHub Desktop.
function add(a, b) {
return parseInt(a) + parseInt(b);
}
if (!process.argv[2] || !process.argv[3]) {
console.log('Insufficient number of arguments! Give two numbers please!');
}
else {
console.log('The sum of', process.argv[2], 'and', process.argv[3],
'is', add(process.argv[2], process.argv[3]));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment