I am Mikhail Evdokimov, a Hobbyist Self Taught Programmer
NodeJS process.argv command line arguments
August
16th,
2016
process.argv is an array containing the command line arguments. The first element will be node, the second element will be the name of the JavaScript file. The next elements will be any additional command line arguments.
Here in for loop for (i = 2; i < process.argv.length; i++) loop begins with 2 because first two elements in process.argv array always is ['path/to/node.exe', 'path/to/js/file', ...]
Converting to number Number(process.argv[i]) because elements in process.argv array always is string