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.
精彩评论