title: (Javascript) Why doesn't function take parameters
body: <p>This is a NodeJS stuff, the code is:</p>
  
  <pre><code>var http = require("http");
  
  function onRequest(request, response) {
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.write("Hello World");
    response.end();
  }
  
  http.createServer(onRequest).listen(8888);
  </code></pre>
  
  <p>My question is how come in the last line, the function onRequest doesn't take parameters.. I'm new to Javascript but isn't onRequest supposed to take 2 parameters as defined in the function? Can anyone help me please? I've been stuck for an hour :(</p>