Created
          December 12, 2014 15:42 
        
      - 
      
- 
        Save mikkoh/af9c50d654825e07819c to your computer and use it in GitHub Desktop. 
    JS Private and Public
  
        
  
    
      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
    
  
  
    
  | module.exports = MyClass; | |
| function MyClass() { | |
| var myPrivatVariable = 10; | |
| return { | |
| publicMethod: function() { | |
| console.log( myPrivatVariable ); | |
| privateMethod.call( this ); | |
| } | |
| }; | |
| } | |
| function privateMethod() { | |
| console.log( this ); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment