By Developers, For Developers

Historical errata for Backbone Marionette

PDF PgPaper PgTypeDescriptionFixed onComments
202SUGGEST

Hi. Your solution for using a sort function can be simplified to the following:

comparator: function (c1,c2) {
if (c1.get(“firstName”) == c2.get(“firstName”)) {
return c1.get(“lastName”).localeCompare(c2.get(“lastName”));
}
return c1.get(“firstName”).localeCompare(c2.get(“firstName”));
}

It’s simpler, easier to understand, a nice way to introduce readers to the handy localeCompare function too!

Hope this helps!

Categories: