News for hackers. Stuff that matters.
Re:New Javascript Class Patterns by IanDrake on Tuesday June 25, 2013 @10:26PM (#5943780)
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();

...

There are no comments on this comment yet.