News for hackers. Stuff that matters.
Re:An Introduction to JavaScript's "this" by diN0bot on Sunday September 27, 2009 @02:35PM (#847106)
one neat way to define a class is like so:

  function MyClass(a, b) {
	// use this function as an instance constructor
	// eg, var m = new MyClass('foo', 'bar');
	this.a = a;
	this.b = b;
  }
  MyClass.prototype = {};
  _extend(MyClass.prototype, {
	instanceMethod: function() {
		...
	},
	...
  });

There are no comments on this comment yet.