Backbone.JS Parse()

The Backbone.JS Parse() model is used to get the model’s data (in the JSON format) by passing through the response object.

Syntax:

Model.Parse (response, options)   

Parameters:
response: This parameter is passed using response raw object in order to get the attributes to be set on the model.
options: This parameter is used to specify the options like id, name etc. for a model.

Example:

  
  
  
Example  
  
  
  
  
  
  
  
 

Output:

{"Messages":{"msg1":"Hello","msg2":"Hi","msg3":"Hey"}}

Explanation:
In the above example, the output is the model’s data in the JSON format.