Command line arguments - forEach (argv)


argv

Try: node argv_foreach.js Hello my world


examples/basic/argv_foreach.js
process.argv.forEach((val, index) => {
    console.log(`${index}: ${val}`);
});

0: /opt/node-v12.14.1-linux-x64/bin/node
1: /home/gabor/work/slides/nodejs/examples/basic/argv_foreach.js