Skip to content

Instantly share code, notes, and snippets.

@danheberden
Created February 2, 2012 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danheberden/1726609 to your computer and use it in GitHub Desktop.
Save danheberden/1726609 to your computer and use it in GitHub Desktop.
Simple Object Contructor With fn
// New Object Template
(function(){
var thing = window.Thing = function( a ) {
return new window.Thing.fn.init( a );
};
thing.fn = thing.prototype = {
constructor: thing,
init: function( a ){
// init the 'thing'
return this;
}
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment