I have a javascript Object like below:
var Loader = function() {}
Loader.prototype = {
constructor: Loader,
foo: function(a, b) {
function bar() {
return a + b;
}
return bar();
}
};
I need to override the bar() function present inside foo . The foo function can be overridden as:
Loader.prototype.foo = function() {}
I have tried the same for inner function but no luck.
Loader.prototype.foo.bar = function() {}//doesnt work
Loader.prototype.foo.protoype.bar = function() {}//doesnt work
I would be very happy if someone could point me in the right direction. Thanks in advance