Node.js Tutorial

Node.js Functions

Source: Bro Code

Functions

Functions group reusable logic behind a name you can call anywhere.

NODEJS
function createServer() {
  return http.createServer((req, res) => {
    res.end('OK');
  });
}
Try it Yourself