Created
          June 16, 2011 13:44 
        
      - 
      
- 
        Save kpuputti/1029253 to your computer and use it in GitHub Desktop. 
    Javascript module 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 namespace = {}; | |
| namespace.module = (function () { | |
| var priv = 'private var'; | |
| return { | |
| init: function () { | |
| // init module | |
| }, | |
| getPriv: function () { | |
| return priv; | |
| } | |
| }; | |
| }()); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment