BackboneJS collection.reset() vs collection.fetch()

backbone.js, javascript

Solution

`reset` sets the collection with an array of models that you specify:

collection.reset( [ { name: "model1" }, { name: "model2" } ] );

`fetch` retrieves the collection data from the server, using the URL you've specified for the collection.

collection.fetch( { url: someUrl, success: function(collection) {
    // collection has values from someUrl
} } );

Here's a Fiddle illustrating the difference.

Problem

I have read and read the docs on these two methods, but for the life of me cannot work out why you might use one over the other? Could someone just give me a basic code situation where one would be application and the other wouldn't.

Original source