failing to effectively implement the elusive prototype concept, I found myself extending objects like this:
function BaseObj(propertyA){
var obj = {
baseProperty: propertyA,
baseMethod: function(){
//doStuff..
}
return obj;
}
function BiggerObj(propertyA, propertyB){
var obj = BaseObj(propertyA);
obj.anotherProperty = propertyB;
obj.anotherMethod = function(){
//doOtherStuff..
};
}
this way of extending objects turned out to be really comfortable and I started getting long chains of this kind of inheritance hirarcy.
my question to those who do understand the prototype model: is there a core difference between dealing with the prototype chain and extending objects like the above method?
are there things that you can do with the prototype that u can't do like this?