This is all fine but once we dive into inheritance things get messy fast. Because JavaScript uses prototypal inheritance (not class inheritance) we have to manually set up parent/child relationships, and in order to do that we have to be able to control what ‘this’ means during the construction of new objects from the child constructor. This will probably just be clear if I show you the code, annotated:
Your new post is loading...