Javascript prototype method override not found
问题 I have this base type: typeA = function () { }; typeA.prototype = { do = function() { alert ("do something"); }, doMore = function() { this.do(); } } and an inherited type typeB: typeB = function () { }; typeB .prototype = new typeA(); typeB.prototype.do = function() { alert ("do something else"); }; When I create an instance of typeB and call doMore, I get an error indicating that this.do is not a function. Can I do this sort of thing in Javascript? 回答1: Is this example what you are looking