L
lielar
Hi
I'm writing a javascript class object that creates objects of itself.
Take for example
function One(x){
this.x = x;
}
One.prototype.addOne = function(x) {
this.extra=x;
}
One.prototype.getOne = function() {
return this.extra;
}
One.prototype.print() = function() = {
return this.x.toString();
}
Then I want to retrieve it where you can retrieve many levels of
'extra'. How do you make a loop to keep on looking in to a child
values of printValus? How do you solve the problem of 'this' in this
scenario? Wouldn't there be a problem with memory leak?
Cheers
Patrick
I'm writing a javascript class object that creates objects of itself.
Take for example
function One(x){
this.x = x;
}
One.prototype.addOne = function(x) {
this.extra=x;
}
One.prototype.getOne = function() {
return this.extra;
}
One.prototype.print() = function() = {
return this.x.toString();
}
Then I want to retrieve it where you can retrieve many levels of
'extra'. How do you make a loop to keep on looking in to a child
values of printValus? How do you solve the problem of 'this' in this
scenario? Wouldn't there be a problem with memory leak?
Cheers
Patrick