How to create and use a function in Node.js

2 Answers

0 votes
function f() {
  console.log("f()");
}

f();

   
   
  
   
/*
run:
   
f()
   
*/

 



answered Mar 1, 2020 by avibootz
0 votes
function f(s) {
  console.log(s);
}

f('Node.js');

   
   
  
   
/*
run:
   
Node.js
   
*/

 



answered Mar 1, 2020 by avibootz

Related questions

...