![]() |
VOOZH | about |
The Backbone.js reset Collection is used to replace the whole list of models with a new list of models or attributes hash. This function returns newly set models in the collection. We can pass null in place of models to make the collection empty.
Syntax:
collection.reset( models, options );
Parameters:
Example 1: In this example, we will illustrate The Backbone.js reset Collection. We will add a new instance of a model which will replace the old models in the collection.
Output:
Example 2: In this example, we will use null in place of the new model to make the collection empty.