【发布时间】:2014-05-19 11:34:19
【问题描述】:
来自https://stackoverflow.com/a/2107571/494461
function Base (string ) {
this.color = string;
}
function Sub (string) {
}
Sub.prototype = new Base( );
var instance = new Sub ('blue' );
如何将字符串变量提前传递给基类?
【问题讨论】:
-
也许下面的答案也可以帮助你。stackoverflow.com/questions/16063394/…
标签: javascript oop inheritance