function Person(name)
{
this.name = name;
this.show = function() {
alert("hi");
}
};
Person.prototype.company = "Microsoft"; //原型的属性
Person.prototype.SayHello = function() //原型的方法
{
alert("Hello, I'm " + this.name + " of " + this.company);
};
function BillGates (name){
//Person.call(this,name);
this.name = name;
}
BillGates.prototype = new Person();
var BillGates = new BillGates("Bill Gates");
BillGates.SayHello(); //alert ------> Hello, I'm Bill Gates of Microsoft
BillGates.show(); //alert ----> hi
BillGates.prototype = new Person();这句话是什么意思 ? 怎么继承的? 不用call也行吗?