title: javascript save function usage
body: <p>I am learning about building a new user login app and there is a line of code the makes me quite confused and Google did not show me any enlightening result. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>module.exports.createUser = function(newUser, callback){
   bcrypt.genSalt(10, function(err, salt) {
       bcrypt.hash(newUser.password, salt, function(err, hash) {
           newUser.password = hash;
           newUser.save(callback);
       });
   });
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>It is quite straightforward: The new user module is trying to crypt the password and runs the callback(It is my understanding). But this line here:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>newUser.save(callback);</code></pre>
  </div>
  </div>
  </p>
  
  <p>It is very confusing to me and would anyone explain what it does here?
  Thank you</p>