3 ms·
Nothing new here. I'm not sure the author understands that he can assign this to a local var in the constructor and use it from the functions. This is a known
by IanDrake 13y ago
Nothing new here. I'm not sure the author understands that he can assign this to a local var in the constructor and use it from the functions. This is a known pattern...
function Point(){
var self = this;
self.x = 0;
...
self.show = function(){
console.log('x=' + self.x);
};
}
var testPoint = new Point();
...