Javascript でクラスを定義するとき、あるメソッドから別のメソッドを呼び出すにはどうすればよいですか?
exports.myClass = function () {
this.init = function() {
myInternalMethod();
}
this.myInternalMethod = function() {
//Do something
}
}
上記のコードを実行すると、次のエラーが表示されます。
ReferenceError: myInternalMethod が定義されていません
this.myInternalMethod と self.myInternalMethod も試しましたが、どちらもエラーになります。これを行う正しい方法は何ですか?