Compare Revisions

Inheritance revisited

Revision 56928:

Revision 56928 by ericbock on

Revision 56929:

Revision 56929 by ericbock on

Title:
Inheritance revisited
Inheritance revisited
Slug:
JavaScript/Guide/Inheritance_Revisited
JavaScript/Guide/Inheritance_Revisited
Tags:
JavaScript, OOP, Inheritance
JavaScript, OOP, Inheritance
Content:

Revision 56928
Revision 56929
n73      So, what happens is: when you calln73      So, when you call
t93      it checks whether <code>o</code> has a property <code>somePt93      it checks whether <code>o</code> has a property <code>someP
>rop</code>, and if not checks <code>o.__proto__.someProp</code>>rop</code>. If not it checks <code>o.__proto__.someProp</code> an
>and if not checks <code>o.__proto__.__proto__.someProp</code> and>d if that doesn't exist it checks <code>o.__proto__.__proto__.som
> so on. This last step is why the <code>extend()</code> function >eProp</code> and so on. This last step is why the <code>extend()<
>works.>/code> function works.

Back to History