function Human(name,age){ Animal.call(this,name); this.age = age; }
Human.prototype = new Animal(); Human.prototype.id = "Human";
Human.prototype.say = function(){ alert("hello everyone,My name is "+this.name +",I'm "+this.age+" and I'm a "+this.id); }
//Human相關(guān)調(diào)用 var jxl = new Human('笨蛋',25); alert(jxl.name);//笨蛋 alert(jxl.id);//Human jxl.say();//hello everyone,My name is 笨蛋,I'm 25 and I'm a Human