First Demo Flip Book
This is my First Demo Flip Book
This is my First Demo Flip Book
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Displaying a Collection of Models 31<br />
23 firstName: "Alice",<br />
24 lastName: "Smith"<br />
25 },<br />
26 ]);<br />
If you refresh the page, you’ll see the contacts in the following order:<br />
• Alice Tampen<br />
• Alice Artsy<br />
• Alice Arten<br />
• Alice Smith<br />
• Bob Brigham<br />
• Charlie Campbell<br />
What we’d like in this case, is to have them sorted by first name, then by last name in case of equality.<br />
Look at the documentation³⁹ and see if you can figure out how to define a comparator function that<br />
will display our collection in the following order:<br />
• Alice Arten<br />
• Alice Artsy<br />
• Alice Smith<br />
• Alice Tampen<br />
• Bob Brigham<br />
• Charlie Campbell<br />
You can see the exercise’s solutions at the end of the book.<br />
³⁹http://backbonejs.org/#Collection-comparator