Backbone.JS Models() collection

The Backbone.JS Models() collection method is used to specify the array of models which are created inside a collection.

Syntax:

Collection.Models   

Example:

  

  
Example  
  
  
  
  
  
  
  


  

Output:

Collection: [{"name":"Jim","age":10},{"name":"Mini","age":15}]

Explanation:
In the above example, the model ‘X’ includes the default values and is extended using the Backbone.Model class, ‘Y’ is a collection instance and The ‘Z.models’ define the array of models inside the collection.