1、由于在原型中查找值的过程是一次搜索,因此我们对原型对象所做的任何修改都能够立即从实例上反映出来---即便是先创建了实例后修改原型也是如此。代码如下:
function Person(){
}
var friend=new Person();
Person.prototype.sayHello=function(){
alert("Hello");
}
friend.sayHello(); //输出:Hello
上面这段代码先创建了Person的一个实例,并将其保存在friend中。接着下一个代码块在Person.prototype(Person的原型属性对对象)中添加了一个方法sayHello();
根据输出,我们发现即使friend实例是在添加新方法之前创建的,但它任然可以访问这个新方法。
其原因可以归结为实例与原型之间的松散连接关系,当我们调用friend.sayHello()时,首先会在实例中搜索名为sayHello的属性方法,如果实例属性中没有,则会继续去搜索原型。而原型与实例之间是通过[[prototype]]指针相连接的(实例通过[[prototype]]指针指向原型属性对象来调用原型中的方法和属性),正因为[[prototype]]是一个指针,并不是Person的副本,所以即使修改(添加)原型的方法在创建完实例之后,该实例任然可以访问完成修改之后的原型对象!
2、尽管利用上面所说的实例与连接的松散连接关系,我们可以随时为原型添加属性和方法,并且修改能够在所有的实例中反映出来。
但是如果重写整个原型对象,那么情况就不一样了,在前面的随笔中曾说过,当调用构造函数创建一个对象实例时JS会为实例添加一个指向最初原型(也就是Person.prototype)的[[prototype]]指针,而像下面的代码中那样,把原型修改成另外一个对象,并不能改变实例中的[[prototype]]指针的值(说明白点,就是实例还是指向最初原型);
注意:实例中的[[prototype]]仅指向最初原型;
function Person(){
}
var friend=new Person();
Person.prototype={
constructor:Person,
name:"张三",
age:22,
sayHello:function(){
alert("Hello James");
}
};
friend.sayHello(); //error 控制台报错!
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAxcAAADzCAIAAAB7f3xiAAAVR0lEQVR4nO3d0ZmqOhQGUOqyIOuhGpuhGM+DHgUCiAzITrLWw/3uKAObEJJ/gKPNHQCA7zVnFwAAkCUpCgBgCykKAGALKQoAYAspCgBgCykKAGALKQoAYAspCgBgCykKAGALKQoAYAspCgBgCykKAGALKQoAYAspCgBgCykKAGALKQoAYAspCgBgi/NT1O3afHa93e/3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EnqU6R7cG/0setwqdouL7ZVs5LgC5KHy8zitFvaNOellqMUWteERdivoTKQqAVOHj9ecUlT7INJuxjr6jd39lnVHkWaxzYitTpKg/0VYApAqfG1akqFGqmXlo+36/J091J+lm8urVF8v/L+96vSQPZM3XOd5K114mrk1JUX+irarlSTVgQeGjw5o7ereZDxCYvsjz+ujzppl4+/+7w7tx3yz/fGniytNcnffRw1E+6eAA2gqAVOFzw9fPRZ1v4kGnPeqUov5EWwGQKnxuyC9FTX1OgRR1Om0FQKrwuaFZ/DbigClq8kth/linbyP+O20FQKrwuWF58guVorrRV830HFSnZLCetgIgVfjc0MBOzu7LAIRjbgAA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2EKKAgDYQooCANhCigIA2OIf4sAaXKFjjXQAAAAASUVORK5CYII=" alt="" />
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAskAAAEiCAIAAACEPNhmAAAfyUlEQVR4nO3d3ZWzuBKFYQKZy4mCgIiHaEiGGCYGz4Ux6A9Z0GWoKt5nzTrna5sG4QJpW2B39wIAAJDT3d0AAADgCtkCAABIIlsAAIBjuq6WH8gWAADgGLKFTx0AAPepjVCXjYWQVa8rAAC/Q7bwiWwBALgL2cInsgUA4C7C2WIaGi7CDNPr9XrNY990yea9dOOq34vvLDpMr2no+nF+r+39j6/msV/bkO1q6Ynai9O4zWw7i/Zf78gWAICb1Megv49P++Pp3pid/nqQLeI11YfqYPWllYT/KGeZajvLwejb0F/f5Z2wFa50nskWAADtJLNF48zCMmB+BtpqRCjEgsp8RzQMN2aLdHPZo3kgKCw1DW2TCkFTMk1hqxXZAgBwl/vmLRb1SyPB74bZojQEz2O/MxMRrG3MssU89tva3kP/zgr6cW7MT59Wtyy8bZxsAQBwoT4GnRifvo6ncdSYx77xL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dbFG4PNLSXtOsDD84wUpxbbQSgCzRHuqTCrLZgO1KSXAtIsgDUc74Pm+xkz7ev1POFsWVer8dw8rwgxOsFNdGKwHIku+h1oE/mDDYhvVgfmJLFPEURmO22JtwIFusrAw/OMFKcW20EoCsX/VQ680N8fgdD/FLpoijRcv9FrVQwDWRlZXhBydYKa6NVgKQJXu/xRDdP9GPc3wH5TKlEQzn09D1wxDfPNFyL+d7TdGNmeHMSCmDpL+S3NrpkZXhBydYKa6NVgKQJdtDBfdVJHMVn8fCayLbb2T3ZTZ8BjW66aLxM6jRfR+er4a8WRl+cIKV4tpoJQBZd/dQ7q9L3Onu4uKHrBTXRisByLq5h0putYAoK8MPTrBSXButBCDr3h4qvUICUVaGH5xgpbg2WglA1l091HK3BHMWv2Rl+MEJVopro5UAZFnpoXACxXXMSnFttBKALCs9FE6guI5ZKa6NVgKQZaWHwgkU1zErxbXRSgCyrPRQOIHiOmaluDZaCUCWlR4KJ1Bcx6wU10YrAciy0kPhBIrrmJXi2mglAFlWeiicQHEds1JcG60EIKsDYNPdnUcTG60EADSyMvzAMQ5BAAAgiWwBAAAkkS0AIGLoqjag0/9JqXZCm5Xh3QAAAABJRU5ErkJggg==" alt="" />
从上面的图我们可以看出,重写原型对象之后,并没有是对象实例的[[prototype]]指针的值发生改变,它还是指向最初的原型对象。