title: need explanation of the _.bindAll() function from Underscore.js
body: <p>I've been learning some backbone.js and I've seen plenty of instances where <code>_.bindAll()</code> is used. I have read through the entire backbone.js and underscore.js documentation page to try to get a sense of what it does, but I still am very fuzzy as to what it does. Here is underscore's explanation:</p>
  
  <blockquote>
  <pre><code>_.bindAll(object, [*methodNames]) 
  </code></pre>
    
    <p>Binds a number of methods on the
    object, specified by methodNames, to
    be run in the context of that object
    whenever they are invoked. Very handy
    for binding functions that are going
    to be used as event handlers, which
    would otherwise be invoked with a
    fairly useless this. If no methodNames
    are provided, all of the object's
    function properties will be bound to
    it.</p>
  
  <pre><code>var buttonView = {
    label   : 'underscore',
    onClick : function(){ alert('clicked: ' + this.label); },
    onHover : function(){ console.log('hovering: ' + this.label); }
  };
  
  _.bindAll(buttonView);
  
  jQuery('#underscore_button').bind('click', buttonView.onClick);
  =&gt; When the button is clicked, this.label will have the correct value...
  </code></pre>
  </blockquote>
  
  <p>If you can help out here by giving another example perhaps or some verbal explanation, anything would be appreciated. I tried to search for more tutorials or examples, but nil turn up that serve what I needed. Most people seem to just know what it does automatically...</p>