Hi guys, I've been programming quite a while in JS. But am a newbie to Node. What a great app learnyounode is!
But this baffled me, perhaps someone cal explain this to me:
for (var i = 2; i < process.argv.length; i++) {
result += Number(process.argv[i]);
This always returned NaN. When I console log each iteration, I always end up with an extra iteration which has the value of NaN. Adding them up results into NaN.
But when I do this:
for (var i = 2; i < process.argv.length; i++) {
result += Number(process.argv[i]);
Everything is fine and the program works as expected.
Who can enlighten me??