I have been read some information about javascript inheritance but i am not sure how to manage the following situation. Let's say i have an object A with the attribute 'b' and 'c'. Attribute 'b' is a class like this:
A.b=function(elements, tags) {
this.elements = elements;
this.tags = tags;
}
A.b.prototype.funct1 = function() {
alert('a');
}
I want attribute "c" to extends class "b" but to add some elements in constructor and define own functions.
A.c = function(elements,tags) {
A.c.prototype = new A.b(elements,tags);
this.var = null;
};
A.c.prototype.funct2 = function(){
alert('funct2');
}
I am using Prototype js. Can you tell if is bad practice or there is an elegant way to do this.