Backbone.JS Model() collection

The Backbone.JS Model() collection method is used to specify the model class.

Syntax:

Backbone.Collection.model  

Example:

  

  
Example  
  
  
  
  
  
  
  


  

Output:

Collection: [{"name":"Tom","age":20}]

Explanation:
In the above example, the model ‘X’ includes the default values and is extended using the Backbone.Model class, and ‘Y’ is an instance of the collection.