24
rated 0 times
[
30]
[
6]
/ answers: 1 / hits: 160843
/ 15 Years ago, wed, february 18, 2009, 12:00:00
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
}
};
More From » prototype