开发者

What is the difference between Parasitic Combination Inheritance and Combination Inheritance in javascript?

The example codes of these two types of inheritance are here:

Parasitic Co开发者_如何学Gombination Inheritance: http://jsfiddle.net/dKKaS/

Combination Inheritance: http://jsfiddle.net/XZn3A/

Could someone tell me the difference? Thanks.


The answer is that with Parasitic Combination Inheritance, the base constructor is only called once. With Combination Inheritance, the constructor gets called two times.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜