function cls(){ this.A = function(s){ var x = s + 'MX'; //问题在这里 this.x(); //我想得出i am here的结果,这里的"x"这个字符串应该如何进行转化? } this.techMx = function(){ alert('i am here'); } }var j = new cls(); j.A('tech');
function cls() { this.A = function (s) { var x = s + 'Mx';//注意大小写 this[x]();/////////// } this.techMx = function () { alert('i am here'); } } var j = new cls(); j.A('tech');
this.A = function (s) {
var x = s + 'Mx';//注意大小写
this[x]();///////////
} this.techMx = function () {
alert('i am here');
}
} var j = new cls();
j.A('tech');