Node.js process sum command line parameters

Description

Node.js process sum command line parameters

//console.log(.argv);

var i=2,sum=0;//from w  w  w .  j  a va  2s. c o  m

while (i < process.argv.length){
  sum=sum+Number(process.argv[i]);
  i++;
}

console.log(sum);



PreviousNext

Related