これが私のコードです。クラス B はクラス A を継承します。
function A() {
this.msg = 'meuahah';
A.prototype.foo = function() {
alert(this.msg);
}
}
function B() {
A.call(this);
B.prototype.bar = function() {
A.prototype.foo();
}
}
a = new A();
a.foo(); // alerts 'meuahah'
b = new B();
b.bar(); // alerts 'undefined'
b.bar() が「meuahah」を表示しないのはなぜですか?