GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing javascript.info — Class extends Object? back to the lesson Class extends Object?importance: 3 As we know, all objects normally inherit from For instance: But if we spell it out explicitly like What’s the difference? Here’s an example of such code (it doesn’t work – why? fix it?):
First, let’s see why the latter code doesn’t work. The reason becomes obvious if we try to run it. An inheriting class constructor must call So here’s the fix: But that’s not all yet. Even after the fix, there’s still an important difference between As we know, the “extends” syntax sets up two prototypes:
In the case of So But if we don’t have Here’s the demo:
So By the way, Here’s the picture: So, to put it short, there are two differences:
| ||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |