title: JavaScript bind vs anonymous function
body: <p><a href="https://github.com/buunguyen/mongoose-deep-populate/blob/master/test/plugin.js#L514" rel="nofollow">This code</a> from mongoose-deep-populate </p>
  
  <pre><code>  async.parallel([
    User.create.bind(User, {_id: 1, manager: 2, mainPage: 1}),
    Comment.create.bind(Comment, {_id: 3, user: 1}),
    ...
  ], cb)
  </code></pre>
  
  <p>uses <code>Function.prototype.bind</code> to ensure that <code>this</code> is bound to the proper object when the callback function <code>User.create</code> is executed in a different context. Is this equivalent to </p>
  
  <pre><code>async.parallel([
      function() { User.create({_id: 1, manager: 2, mainPage: 1}) }, 
      function() { Comment.create({_id: 3, user: 1}) },
  ], cb) 
  </code></pre>
  
  <p>?</p>
  
  <p>If so, in what situation is <code>bind</code> a more preferable syntax compared to using an anonymous function?</p>