Home » Backbone.js collection.sort()

Backbone.js collection.sort()

by Online Tutorials Library

Backbone.js collection.sort()

In Backbone.js, sort collection method is used to sort the items in the collection. It is used with comparator property in order to sort the items.

Syntax:


Parameter explanation:

options:It specifies two parameters “true” or “false” to enable or disable the sorting.

Let’s take an example to deploy sort collection method.

See this example:

You may also like