The above code doesn't work?
this.x = 1;
Foo.prototype.AddX = function(y) // Define Method
this.x += y;
obj = new Foo;
The script you posted seems to work fine to me. Are you having trouble with it? It's a good example for someone new to the prototype property.
"Class" I saw it in PHP. Is it of similar function? I think I got the code working already.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)