title: Differences in javascript module pattern
body: <p>Very simple question, not sure if there are any differences in these ways of creating a javascript "module". I'm hoping somebody can clarify it for me.</p>
  
  <p>A)</p>
  
  <pre><code>var foo = function() {
      var bar = function() {
          console.log('test');
      };
  
      return {
          bar: bar
      };
  };
  </code></pre>
  
  <p>B)</p>
  
  <pre><code>var foo = function() {
      function bar() {
          console.log('test');
      };
  
      return {
          bar: bar
      };
  };
  </code></pre>
  
  <p>C)</p>
  
  <pre><code>var foo = function() {
      this.bar = function() {
          console.log('test');
      };
  
      return {    
          bar: this.bar
      };
  };
  </code></pre>