In our current code base, we create classes like this
my_class = function(){ //do some constructor stuff } my_class.prototype = { var1 : 'value', var2 : 'value', var3 : 'value' . . . //etc }
There are several classes that I would like to inherit a superclass from. However, if I do something like this, I will eventually rewrite the prototype of the superclass.
my_super_class = function(){ } my_super_class.prototype.generic_function = function(){
Is there a better way to do this than my_class.prototype.val1 = 'value'; ... etc. after superclass inheritance? I would like to stick to the convention from our current code base, because it is short and corresponds to a point.
source share