INHERITANCE VERSUS PROTOTYPING

This page shows how to realize some kind on inheritance in JavaScript, trying to get the same results of the prototyping page. The result is that prototyping seems to be the better choice, rather then inheritance. This also because prototyping is a standard practice in JavaScript, while inheritance is not.
To see the JavaScript code click on the show code label below, or have a look to the HTML source of this page.

The tutorial shows also how to read objects properties using associative arrays (and the in operator).


   

               




Show code