JSFiddle - React, Tailwind, and code Playground
by Cody Lindley
HTML
<script src="https://dl.dropboxusercontent.com/u/2026291/backbone/jquery-2.0.2.js"></script>
<script src="https://dl.dropboxusercontent.com/u/2026291/backbone/lodash.underscore.js"></script>
<script src="https://dl.dropboxusercontent.com/u/2026291/backbone/backbone.js"></script>
<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
JavaScript
var contacts = new Backbone.Collection([
{firstName: 'Luke'},{firstName: 'John'},
{firstName: 'Bill'},{firstName: 'Jill'}
],{model:Backbone.Model});
//remove the Luke model from the collection
contacts.remove(contacts.findWhere({firstName:'Luke'}));
//remove array of model instances
contacts.remove([
contacts.findWhere({firstName:'John'}),
contacts.findWhere({firstName:'Bill'})
]);
//Verify the that the model's were removed
console.log(contacts.pluck('firstName')); //logs ["Jill"], Luke, John, Bill were removed