This is an example of a neat way of handling classes in ECMAScript 5. ECMAScript 6 provides a way to handle classes natively which would thankfully make this trick redundant.
Class style object instantiation with prototype
The defacto standard for managing constructor based object inheritance.
Having to add dangling prototype assignments outside of constructors is a scattered way of dealing conceptually with what should be a unified entity, also, if you want to hide data privately one would have to use the parent scope which could be shared across objects limiting the point of hiding such information. Lets try to pull it all together with some simple syntactic sugar.
The benefits of using this style of object programming are that the object is encapsulated within its own function scope whilst at the same time having a clear constructor as well as providing a place for declaring private closure variables that can act as member variables.
Now let me talk a little about how we get here...
Creating the Base with some meta-programming.
Use the following snippet to create a Base object:
This allows us to use the following syntax to define classes: