title: Javascript return value from nested function prints undefined
body: <p>Here i'm trying to return value from bcrypt.compare, nested inside a function.</p>
  
  <p>I want to get the result value (true or false).</p>
  
  <p>Im using coffeescript. Here is the code:</p>
  
  <pre><code>comparePasswordWithHash = (pass, hash) -&gt;
    return bcrypt.compare pass, hash, (err, result) -&gt;
      if err
        throw err
      else
        return result
  
  console.log comparePasswordWithHash "bacon", hashedPassword # Should print true/false
  </code></pre>
  
  <p>With this code, value printed is undefined.</p>