Javatpoint Logo
Javatpoint Logo

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:

Test it Now

Output:

Save the above code in sort.html file and open this file in a new browser.

BackboneJS Sort Collection
Next TopicBackbone.js Pluck





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA