News for hackers. Stuff that matters.
Re:Learn You The Node.js by mneary on Saturday February 01, 2014 @06:00PM (#7163853)
A far cleaner solution:

    console.log(process.argv.slice(2).reduce(function(a, x) {
      return a + parseFloat(x) 
    }, 0));
Re:Learn You The Node.js by jamescarl on Saturday February 01, 2014 @06:07PM (#7163873)
Awesome! Thanks a ton for the suggestion.
Re:Learn You The Node.js by dsego on Sunday February 02, 2014 @09:04AM (#7165993)
Why is that cleaner? A for-loop is one of the basic programming constructs.
Re:Learn You The Node.js by mneary on Monday February 03, 2014 @08:33PM (#7174914)
A for-loop might be a basic programming construct, but it shouldn't be. Mutation and a control flow construct makes for a much worse outlook to the problem than does recursive application of a function.
Re:Learn You The Node.js by agumonkey on Sunday February 02, 2014 @04:34PM (#7167679)
reduce is one very fundamental construct too https://www.google.com/search?q=universality+of+reduce
Re:Learn You The Node.js by Scryptonite on Saturday February 01, 2014 @08:43PM (#7164389)
Least bytes?

  var a=process.argv,i=a.length,x=0;while(i>2)x-=-a[--i];console.log(x)
Re:Learn You The Node.js by jamescarl on Sunday February 02, 2014 @01:39PM (#7166929)
That's a neat approach! Thanks