title: nodejs what is the difference between return callback() and just callback()
body: <p>I think this might actually answer another of my questions on <a href="https://stackoverflow.com/questions/41878325/nodejs-error-callback-was-already-called">Stack Overflow</a> if I can get this confirmed.</p>
  
  <p>What is the difference between returning a callback and just calling a callback?</p>
  
  <p>I have seen code doing either/or/both and trying to wrap my head around why and when to do which.</p>
  
  <pre><code>function test(x, y, callback){
      return callback(null, x);
      callback(null, x + y);
  }
  
  test(1, 2, function(err, results){
      if(!err){
          console.log('results:\n', results);
      } else {
          console.error('err:\n', err);
      }   
  });
  </code></pre>
  
  <p>Edit: 
  I think part of my questions resolves around my <a href="https://stackoverflow.com/questions/41878325/nodejs-error-callback-was-already-called">linked question</a>, where I would constantly get an error, callback already called.</p>
  
  <p>I was trying to understand the conceptual difference between these two different ways to do in my mind the same thing. Not sure why I am getting voted down when I ask a question to better understand a concept I haven't grasped yet. Aren't we all here to expand on our knowledge of programming by asking questions of better programmers than ourselves?</p>