Backbone.JS PreviousAttributes()

The Backbone.JS PreviousAttributes() model is used to get the state of all the attributes prior to the last change event.

Syntax:

Model.PreviousAttributes ()   

Example:

  

  
Example  
  
  
  
  
  
  
  


  

Output:

All the previous attributes of the model X before the change are: 
{"msg1":"HELLO WORLD.","msg2":"Welcome."}

Explanation:
In the above example, all the previous attributes of the model X before the change are returned as the output.