I\'m using one of the approaches to class inheritance in JavaScript (as used in the code I\'m modifying), but do not understand how to attach additional functionality for a
The variable var parentVar = inVar;
is a local and private variable available only in the Parent()
function and visible only to functions defined in the same scope (Parent()
).
I think that best way here would be to modify the Parent class in such way that the parentVar
wouldn't be private, but public:
function Parent(inVar) {
this.parentVar = inVar;
}