function C(){
}
C.prototype={
V:{a:0,b:1},
F:function(){
alert(a);
}
}
Vのメンバ変数はC.prototype.aへの参照になる。
まあ言われてみりゃそうだよな…。
function C(){
this.V={a:0,b:1}
}C.prototype={
V:null,
F:function(){
alert(a);
}
}
コレが正解。
ネコと和解せよ
function C(){
}
C.prototype={
V:{a:0,b:1},
F:function(){
alert(a);
}
}
Vのメンバ変数はC.prototype.aへの参照になる。
まあ言われてみりゃそうだよな…。
function C(){
this.V={a:0,b:1}
}C.prototype={
V:null,
F:function(){
alert(a);
}
}
コレが正解。