0
am beginner in dev and would like to know how to pass a parameter via function. For example:
function hello(name) {
console.log("hello " + name);
}
hello("Fulano");
If I roll Node hello, he will return me "Hello So-and-so".
I would like to pass the parameter along with the function. That is, I want to run Node hello So-and-so and I want him to return me "Hello Fulano". How to proceed?
The parameters passed are in the object
process.argv
, take a look at him.. did not pass straight to Function, but you can read and call the Function– Ricardo Pontual