function Class01( val, pVal,v ) {
this.val = val; /*实例可直接读写的属性*/
var pVal = pVal;
this.getpVal = function () {
return pVal;
};
this.setpVal = function ( v ) {
pVal = v;
return this;
}
this.getpVal()
this.setpVal();
console.log(this)
}
Class01(1,2,9)
this.getpVal 和 this.setpVal在window上没有return的值 是我console的不对吗?
你想获得什么效果你描述清楚一点
你这个代码很有问题