1
私の親クラスは、私の子供はコール親プロトタイプ
function Child(){ Parent.call(this, arguments) }
Child.prototype._start = function(){ this.get() /* error here - this.get is not a function*/ }
util.inherits(Child, Parent);
私は
new Child().start()
を行うと、私はエラーthis.get is not a function
を持っている
function Parent() {}
Parent.prototype.get = function() {}
Parent.prototype.start= function() { this._start() }
です。親プロトタイプ関数をどのように呼び出すことができますか?ありがとう。
'はconsole.log(これは)' ES6クラスを使用することを検討して – Laazo
何 'this'リファレンスを参照していることだろう場合と'super'メソッドです。 – zero298