Why assign `this` to `self` and run `self.method()`?
<p>I'm reading the source from mongoose: <a href="https://github.com/LearnBoost/mongoose/blob/master/lib/collection.js#L40" rel="nofollow">https://github.com/LearnBoost/mongoose/blob/master/lib/collection.js#L40</a></p>

<pre><code>Collection.prototype.onOpen = function () {
  var self = this;
  this.buffer = false;
  self.doQueue();
};
</code></pre>

<p>I don't understand why the author assign <code>this</code> to <code>self</code> and run <code>self.doQueue()</code>. Why don't just run:</p>

<pre><code>this.buffer = false;
this.doQueue();
</code></pre>

<p>I'm new to javascript, thanks for help.</p>
