Backbone.JS Parse()

The Backbone.JS Parse() collection method is used to get the collection’s data by passing through the response object.

Syntax:

Collection.Parse ( response, options )   

Parameters:
response: This parameter is used to specify the array of model attributes.
options: This parameter is used to specify whether to represent the data in JSON format or not.

Example:

  

  
Example  
  
  
  
  
  
  
  


  

Output:

{"names":[{"first":"Jimmy","second":"Tommy","third":"Bruno"}]}

Explanation:
In the above example, the Parse() method is used to get the value of the ‘data’ extracted by the collection Y when parse is set as “true”.