title: Backbone.js: How do I filter a collection of objects by an array of model IDs?
body: <p>I've got a <code>Backbone.Collection</code> full of models; let's say that model is <code>Car</code>. This collection is a great, big list of <code>Cars</code>. I want to be able to have a few specific car IDs selected from a list, and then be able to get just those selected car objects out of this collection.</p>
  
  <p>My code block below isn't working; I'm sure there's a way to do this with Backbone.js/Underscore.js… I'm pretty fresh to Backbone/Underscore, too.</p>
  
  <pre><code>CarList = Backbone.Collection.extend({
      model: Car,
      filterWithIds: function(ids) {
          return this.filter(function(aCar) { return _.contains(ids, car.id); }
      }
  });
  </code></pre>
  
  <p>Any pointers?</p>