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 contact1Model = new Backbone.Model({id:01,FirstName: 'John',lastName: 'Doe',phone: '1-111-1111'
});
var contacts = new Backbone.Collection(contact1Model);
//all of the below return a reference to the contact1Model in the contacts collection
//using get()
console.log(contacts.get(contact1Model));
console.log(contacts.get(01));
console.log(contacts.get('c1'));
//using at()
console.log(contacts.at(0));
//using findWhere()
console.log(contacts.findWhere({lastName:'Doe'}));
//Note each of these return a reference to the contact1Model
console.log(contacts.get(contact1Model) === contact1Model);
console.log(contacts.get(01) === contact1Model);
console.log(contacts.get('c1') === contact1Model);
console.log(contacts.at(0) === contact1Model);
console.log(contacts.findWhere({lastName:'Doe'}) === contact1Model);