JavaScript OOP Tutorial: Inheritance through Prototyping

This is a JavaScript DOM exercise from Chapter 3 of Microsoft AJAX Library Essentials: JavaScript in ASP.NET AJAX 1.0 Explained.

Once again, prototyping can help us implement an OOP feature in a more elegant way than when using closures. Prototype-based inheritance makes use of the behavior of JavaScript prototypes. When accessing a member of a function, that member will be looked in the function itself. If it’s not found there, the member is looked in the function’s prototype. If it’s still not found, the member is looked in the prototype’s prototype, and so on until the prototype of the implicit Object object. Continue reading