On 7/17/16, 10:51 PM, "Harbs" <harbs.li...@gmail.com> wrote:
>A number of reasons: >1. performance >2. If the code does calculations which might change later on >3. If it needs to always reference the same object, you don’t want it >reassigned. But who would call it more than once? > >For instance initialization, you need to setup your prototype only once, >or bad things could happen — and the bas class’ prototype needs to be >setup first. IMO, the prototype is not the instance. > >As far as initializing vs constructor goes: > >The prototype of the superclass needs to be defined first, but >initialization code in the super-class' constructor might need to be run >second. I think I would need to see actual code examples for these scenarios in order to understand when the order of constructors needs to be controlled. -Alex