var Person = Backbone.Model.extend({
defaults:{
name:"John Smith"
}
});
var Fruit = Backbone.Model.extend({
defaults:{
name: "Apple"
}
})
var Persons = Backbone.Collection.extend({
model: Person
});
var person1 = new Person({name:"Jim Smith"});
var personsCollection = new Persons();
var fruit1 = new Fruit({name: "Orange"});
personsCollection.add([fruit1]);
console.log(personsCollection.models[0].get("name"));