Created
February 2, 2012 23:59
-
-
Save danheberden/1726609 to your computer and use it in GitHub Desktop.
Simple Object Contructor With fn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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