Last active
November 6, 2015 21:38
-
-
Save ericelliott/3701667 to your computer and use it in GitHub Desktop.
Flyweight Factory Module Pattern
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
var myPrototype = { | |
methodA: function methodA() {}, | |
methodB: function methodB() {}, | |
methodC: function methodC() {} | |
}; | |
createFoo = function createFoo() { | |
return (Object.create(myPrototype)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great example of an alternative to constructors!