var A = function(name){
this.name=name;
}
A.prototype = {
sayName:function(){
alert(this.name);
}
}
var B = function(age){
this.age = age;
}
B.prototype = {
sayAge : function(){
alert(this.age)
}
}
//function C(){};
var c = new C("white",25);
c.sayName();
c.sayAge();
相关分类