我有以下代码但是我得到了错误Uncaught TypeError: Object #<addThis> has no method 'returnValue' (anonymous function)
function addThis() {
this.value1 = 1;
this.value2 = 2;
var returnValue = function () {
return (this.value1 + this.value2);
}
}
//Instantiate object and write response
var simpleObject = new addThis();
document.write(simpleObject.returnValue());