Created
June 6, 2013 06:41
-
-
Save clouddueling/5719732 to your computer and use it in GitHub Desktop.
Javscript modular pattern
This file contains hidden or 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 NewsWidget = (function(window, document, undefined){ | |
| // private | |
| var name = ‘Chris’; | |
| function createMember() { | |
| } | |
| // public | |
| return { | |
| getName: function() { | |
| return name; | |
| }, | |
| create: createMember, | |
| update: function() { | |
| } | |
| } | |
| })(this, document); | |
| NewsWidget.create(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment