Answer the question
In order to leave comments, you need to log in
How to correctly refer from a child object to a parent object in javascript?
There is a code in which the child object refers to the parent in this way
function JClass() {
this.v = 1;
};
JClass.prototype = {
newo:function(){
var t=this;
return {
readv:function(){alert(t.v)}
}
}
};
new JClass().newo().readv();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question