title: Where do variables declared in an IIFE go?
body: <p>So I understand the purpose of an IIFE is to take them out of the global scope. In the Angular style <a href="https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md" rel="nofollow">guide</a>, it says to avoid this:</p>
  
  <pre><code>/* avoid */
  // logger.js
  angular
      .module('app')
      .factory('logger', logger);
  
  // logger function is added as a global variable
  function logger() { }
  
  // storage.js
  angular
      .module('app')
      .factory('storage', storage);
  
  // storage function is added as a global variable
  function storage() { }
  </code></pre>
  
  <p>and instead do this:</p>
  
  <pre><code>/**
  * recommended
  *
  * no globals are left behind
  */
  
  // logger.js
  (function() {
      'use strict';
  
      angular
          .module('app')
          .factory('logger', logger);
  
      function logger() { }
  })();
  
  // storage.js
  (function() {
      'use strict';
  
      angular
          .module('app')
          .factory('storage', storage);
  
      function storage() { }
  })();
  </code></pre>
  
  <p>I'm assuming this makes the storage function available for me to call in a controller some time later... but where exactly is it if it's not in the global scope?</p>