var Song = Backbone.Model.extend({
validate: function(attr)
{
if(attr.title)
return "Title is required";
}
});
var song = new Song();
console.log(song.isValid());
/*console log true*/
var Animal = Backbone.Model.extend({
walk: function(){
console.log("Animal walking…");
}
});
var Dog = Animal.extend({
walk: function(){
Animal.prototype.walk.apply(this);
console.log("Dog walking…");
}
});
var dog = new Dog();
dog.walk();