Is it possible to call the base method from a prototype method in JavaScript if it’s been overridden?
MyClass = function(name){ this.name = name; this.do = function() { //do somthing } }; MyClass.prototype.do = function() { if (this.name === 'something') { //do something new } else { //CALL BASE METHOD } };
I did not understand what exactly you’re trying to do, but normally implementing object-specific behaviour is done along these lines: