Skip to content

Instantly share code, notes, and snippets.

@schonstal
Created November 29, 2011 19:39
Show Gist options
  • Save schonstal/1406126 to your computer and use it in GitHub Desktop.
Save schonstal/1406126 to your computer and use it in GitHub Desktop.
function MyClass(config) {
this.initialize(config);
}
MyClass.prototype = {
initialize: function(config) {
//this is the constructor
this._foo = config.foo;
},
herpDerp: function() {
console.log(this._foo);
}
}
myClass = new MyClass({'foo':'bar'});
myClass.herpDerp();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment