是否可以在javascript中使用其子类中的父类中的方法?

时间:2010-09-19 12:49:37

标签: javascript inheritance

是否可以在javascript中使用子类中覆盖版本的父类中的方法?

3 个答案:

答案 0 :(得分:3)

是:

ParentClass.prototype.methodName.call(this, arg1, arg2);

答案 1 :(得分:0)

您可以在子类的覆盖版本中调用以下内容:

ParentClass.prototype.methodYouAreOverwriting.call(this);

答案 2 :(得分:0)

如果您使用的是模块模式,请查看以下文章:http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth