0
荫的获得上述错误代码(9号线):遗漏的类型错误:无法读取属性 'X' 未定义
pair = function(x,y){
this.x = x;
this.y = y;
}
alpha = function(){
this.field = new pair(0,0);
this.fun = function(){
console.log(this.field.x);
}
}
function beta(para){
para();
}
beta(new alpha().fun);
但呼叫,如:
new alpha().fun();
工作正常。
有人可以解释在这种情况下发生了什么?