开发者

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

开发者 https://www.devze.com 2023-02-20 05:23 出处:网络
The example codes of these two types of inheritance are here: Parasitic Co开发者_如何学Gombination Inheritance: http://jsfiddle.net/dKKaS/

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

精彩评论

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