Skip to content

Instantly share code, notes, and snippets.

@fogus
Forked from jashkenas/js.next-classes.js
Created October 31, 2011 14:19
Show Gist options
  • Select an option

  • Save fogus/1327590 to your computer and use it in GitHub Desktop.

Select an option

Save fogus/1327590 to your computer and use it in GitHub Desktop.
// From: https://mail.mozilla.org/pipermail/es-discuss/2011-October/thread.html#17696
const className = superClass <| function(/*constructor parameters */) {
//constructor body
super.constructor(/*arguments to super constructor */);
this.{
//per instance property definitions
};
}.prototype.{
//instance properties defined on prototype
}.constructor.{
//class (ie, constructor) properties
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment