Javatpoint Logo
Javatpoint Logo

Backbone.js collection.reset()

The Backbone.js collection reset is used to replace a collection with a new list of models. It updates the collection in bulk. It can reset the collection with a new list of models or will empty the entire collection.

It is different from adding and removing collection because they are good to change one at a time. On the other hand, Reset collection makes changes in bulk.

Syntax:


Parameter explanation:

models: It specifies names of the collection instances, which are need to be reset in the collection.

options: It contains null value to empty the collection.

Let's take an example.

See this example:

Test it Now

Output:

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

BackboneJS Reset Collection
Next TopicBackbone.js Set





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