<script type="text/javascript">
//The model 'MyTeam' includes default values and extended using the Backbone.Model class
var MyTeam = Backbone.Model.extend({
defaults: {
player: "Dhyanchand",
country: "India"
},
});
//'MyTeam1' is an instance of the collection
var MyTeam1 = Backbone.Collection.extend({
model: MyTeam //model 'MyTeam' is specified for a collection by overriding the 'model' property
});
//The collection 'MyTeam1' is instantiated by using new keyword
var myval=new MyTeam1({});
//The JSON.stringify() method returns values of collection in the JSON format
document.write("The values in the collection are: ",JSON.stringify(myval));
</script>