Answers for "run nodejs with args"

5

nodejs command line arguments

var myArgs = process.argv.slice(2);
console.log('myArgs: ', myArgs);
Posted by: Guest on July-12-2021
-2

node js args

var arguments = process.argv
  
function add(a, b) {
  
    // To extract number from string
    return parseInt(a)+parseInt(b) 
}
  
var sum = add(arguments[2], arguments[3])
  
console.log("Addition of 2, 3 is ", sum)
Posted by: Guest on April-10-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language