
function toInt(num) { return parseInt(num, 10); }

// Read command line arguments
var args = process.argv,
    n = args.length;

var numbers = args.slice(2, n).map(toInt);

var sum = numbers.reduce(function(total, num) {
  return total + num;
}, 0);


console.log(sum);

#!/usr/local/bin/node

function toInt(num) { return parseInt(num, 10); }

// Read command line arguments
var args = process.argv,
    n = args.length;

var numbers = args.slice(2, n).map(toInt);

var sum = numbers.reduce(function(total, num) {
  return total + num;
}, 0);


console.log(sum);

Add the bang line to eecute the file directly
Add the bang line to eecute the file directly
