Backbone.js model.previousAttributes()

The Backbone.js PreviousAttributes model returns the model's previous attributes before the last change event. It is used to get the difference between the versions of a model, or restore the previous attributes after an error occurs.

Syntax:

Let's take an example.

See this example:

Test it Now

Output:

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

BackboneJS previousattributes Model



Latest Courses