Complete the code to print all command line arguments.
console.log(process.[1]);The process.argv array contains all command line arguments passed to a Node.js script.
Complete the code to print the third command line argument.
console.log(process.argv[[1]]);The first two elements of process.argv are the Node.js executable path and the script path. The third element (index 2) is the first user argument.
Fix the error in the code to correctly access the command line arguments array.
const args = process.[1];
console.log(args);The correct property to access command line arguments is argv, not 'arguments' or 'args'.
Fill both blanks to print the number of user arguments passed (excluding Node and script paths).
const userArgsCount = process.[1].[2] - 2; console.log(userArgsCount);
process.argv is an array, so use length to get its size. Subtract 2 to exclude Node and script paths.
Fill all three blanks to create an array of user arguments (excluding Node and script paths).
const userArgs = process.[1].[2]([3]); console.log(userArgs);
splice which modifies the original array.process.argv is an array. Use slice(2) to get a new array starting from index 2, which excludes Node and script paths.