title: Node.js - callback parameters
body: <p>I'm currently learning about callbacks in Node and JavaScript in general and am getting confused by the following:</p>
  
  <pre><code>var request = require('request');
  
  request('http://www.google.com', function (error, response, body) {
   if (!error &amp;&amp; response.statusCode == 200) {
  console.log(body) // Show the HTML for the Google homepage. 
    }
  })
  </code></pre>
  
  <p>My question is this: How does the request function know what each parameter/argument is in the callback? Because I could effectively call the function callback with two parameters and skip out the error? How would the function know that the first parameter passed was the response and not the error, for instance?</p>
  
  <p>Does it do checks on the types of each at runtime or? Thanks.</p>