I have following code :
function A() {
this.value = 'a_value';
}
A.prototype.getValue = function(){
console.log(this.value); // got undefined, expected 'a_value'
}
setTimeout(new A().getValue, 100);
why i get this.value
as undefined.?
and how how do i access this.value
?
EDIT : i am not allowed to change the setTimeout
line (last line) of code.