摘要:
1 function Animal(){ this.name='animail'; this.showName = function(){ alert(this.name); } } function cat(){ this.name='cat'; } var animal = new Animal(); var c = new cat(); animal.showName.call(c);Animal.call(cat); //让cat继承Animal的属性cat.showName(); //alert('animail'); function 阅读全文